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:
The change would produce the following in a feature popup:
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)
Thoughts?
Solved! Go to Solution.
Michael,
OK, the change for 1.2 is simple to get the time to show.
In the Widget.js for the Query widget find the _tryLocaleNumber function and change the code from:
_tryLocaleDate: function(date){ var result = jimuUtils.localizeDate(date, { selector: 'date' }); if(!result){ result = date.toLocaleDateString(); } return result; },
to:
_tryLocaleDate: function(date){ var result = jimuUtils.localizeDate(date); if(!result){ result = date.toLocaleDateString(); } return result; },
Michael,
The query widget produces a layer using the query results and that new layer is not using the popup defined in the webmap, but the one defined in the Query widget UI.
makes sense. So I need to change the query code to be able to include Time? I dont see any configuration ability in the Query Widget to also have time be included in date field calls.
Results settings only has the following:
Michael,
By default the date field if it includes time will be displayed with date and time. Here is an example image of my app that has a date field and it is showing the time.
Then something is wrong as the field contains Date/Time information as shown above when enabling with the custom popup.
Michael,
I just tested another layer with date and time and same result it shows up automatically. I am testing in WAB 1.3
Perhaps this works in Version 1.3 and not in 1.2. (sigh)
I just tried a new blank new Web App, and get the same result (no TIME).
Here is a screen shot of the Attribute Table in the same Test Web App..
Michael,
OK, the change for 1.2 is simple to get the time to show.
In the Widget.js for the Query widget find the _tryLocaleNumber function and change the code from:
_tryLocaleDate: function(date){ var result = jimuUtils.localizeDate(date, { selector: 'date' }); if(!result){ result = date.toLocaleDateString(); } return result; },
to:
_tryLocaleDate: function(date){ var result = jimuUtils.localizeDate(date); if(!result){ result = date.toLocaleDateString(); } return result; },
How does one learn WABde as much as you have?
Thanks for showing that a simple selector bit of code is there and simply needs to be removed.
This of course means I can select TIME only or DATE only at any instance.
, {
selector: 'date'
}