Select to view content in your preferred language

Display date field in Popup with MM/YYYY format in WebMap

887
5
05-16-2022 12:50 PM
Labels (1)
JoseSanchez
Frequent Contributor

**bleep** oeveryone,

 

Is there a way to format  a date filed in a Popup  window in a WebMap?

I would like to display only month and year  (MM/YYYY)

Thanks

 

0 Kudos
5 Replies
SteveCole
Honored Contributor

You could use an Arcade Expresison to do that work. Example:

var theDate = Now();
var theMonth = Month(theDate) + 1; //Month() returns a value 0-11 so add 1 to it

return theMonth + '/' + Year(theDate);

 

0 Kudos
KenBuja
MVP Esteemed Contributor

A simpler way would be to use Text formatting

var date = Now();
return Text(date,"MM/YYYY");

 

RhettZufelt
MVP Notable Contributor

If you want just name of the month and year ( May 2022 ), that is built in to the popup configuration in the Classic map viewer, and the fields tab in the new map viewer.

R_

0 Kudos
JoseSanchez
Frequent Contributor

Thank you.

How do I check for null values in arcade?

 

 

0 Kudos
RhettZufelt
MVP Notable Contributor
0 Kudos