I have a feature with a date field that I want to include in a popup. In the AGOL web map you have the ability to customize the date format but not so when using the popupTemplate in the JS.
See here, Road Closures.
Click on a feature then search for street name (S IRVINE ST for example) to see difference. Any idea how to fix this? Should I be using an arcade expression to convert? How is the AGOL map doing it?
Scott
Solved! Go to Solution.
Scott,
you can absolutely format date fields in the 4.x PopUpTemplate:
{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}
produces 4/8/2009
https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content
Look for "The formatter functions" section.
Scott,
you can absolutely format date fields in the 4.x PopUpTemplate:
{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}
produces 4/8/2009
https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content
Look for "The formatter functions" section.
Indeed, you're correct. Thanks, Robert.
Scott