Select to view content in your preferred language

ESRI JS 4.x popup template

1195
2
Jump to solution
11-02-2017 07:56 AM
deleted-user-OlpHy1NoMNug
Deactivated User

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

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

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.

deleted-user-OlpHy1NoMNug
Deactivated User

Indeed, you're correct.  Thanks, Robert.

Scott

0 Kudos