arcade expression - Date vs Text function
I want to apply simple logic to my popup window base on 2 Data fields. If the value is null, I'd like the popup to return "None", and if there is a date value, return in MMMM D Y format. The is Null portion is straight forward, but when comes to display the date to the format shown above, I either get more than I need with the Date function or I don't get anything at all with the Text function.
if (IsEmpty($feature.Date)){
return "None"
} else {
return Text($feature.Date, 'MMMM DD, Y');
the above yield me nothing in popup. Nothing is shown, including the None portion
if (IsEmpty($feature.Date)){
return "None"
} else {
return Date($feature.Date);
the above give me more than I need on if a Date value is available
"Thu Mar 21 2019 20:00:00 GMT-0400 (Pacific Daylight Time)"
How can I achieve Mar 21, 2019 format with Arcade in my popup when date is available?
-
Have you tried
Text(Date($feature.Date), 'MMMM DD, Y')
0 -
Thanks Brian Bieber. That's it! I should have thought of it because I tried Text(ToUTC($feature.Date, 'MMMM DD, Y')) which did not work.
0
Please sign in to leave a comment.
Comments
2 comments