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

539
5
05-16-2022 12:50 PM
JoseSanchez
Occasional Contributor III

**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
Frequent 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 Frequent 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
Occasional Contributor III

Thank you.

How do I check for null values in arcade?

 

 

0 Kudos
RhettZufelt
MVP Frequent Contributor
0 Kudos