Select to view content in your preferred language

Include 'TIME' with Date field for Popup works but nothing exists for Query Results?

3676
12
Jump to solution
12-18-2015 09:27 AM
MichaelRobb
Regular Contributor II

I have a question if this requires customizing or if I have missed a means of having this work out of the box.

Scenario

Web Map.  Configuring Popup, you can select to have Time included with Date field (Configuration)

As seen here:

1.png

The change would produce the following in a feature popup:

2.png

In the Web application Query widget... pointing to the same layer... If a Query is Initiated, the result as well as the Popup when clicking on the result shows the following:  (No Time)

3.png

Thoughts? 

0 Kudos
12 Replies
RobertScheitlin__GISP
MVP Emeritus

Michael,

   I am just good a deciphering code, because I write code everyday.

0 Kudos
MichaelRobb
Regular Contributor II

Of course ESRI broke this in WAB 2.1  Back to only displaying a Date, without time.

Are you able to point me in the direction?

I have found the code block in Widgets\Query\SingleQueryLoader.js

but I cant get the time to appear in the query results or query result popup.

_tryLocaleDate: function(date){
var result = jimuUtils.localizeDate(date);
if(!result){
result = date.toLocaleDateString();
}
return result;
},

0 Kudos
MichaelRobb
Regular Contributor II

Looks like I had looked too deep into this...

this is now done through the config.json file.

e.g.

{
"fieldName": "CLOSE_TIME",
"label": "CLOSE_TIME",
"tooltip": "",
"visible": false,
"format": {
"dateFormat": "shortDateShortTime"
},
"stringFieldOption": "textbox"
},