Arcade expression for date equals today or earlier

694
2
Jump to solution
07-27-2020 11:37 AM
LeifJohnson3
Occasional Contributor II

How can I write an arcade expression that would change the symbology of a webmap based on whether or not a date is equal to or before today's date?

0 Kudos
1 Solution

Accepted Solutions
DonaldShaw2
Esri Contributor

Hi, you can do something like this:

var event_time = $feature.eventTime;

var today_date = Today();
var diff = DateDiff(today_date, event_time, 'days');


if(diff > 0){
return 'before today';
}

else(diff <0)
return 'today';

View solution in original post

2 Replies
DonaldShaw2
Esri Contributor

Hi, you can do something like this:

var event_time = $feature.eventTime;

var today_date = Today();
var diff = DateDiff(today_date, event_time, 'days');


if(diff > 0){
return 'before today';
}

else(diff <0)
return 'today';

View solution in original post

LeifJohnson3
Occasional Contributor II

Thank you so much Donald Shaw. This is extremely helpful!