Hello, I am new to arcade and am looking for any advice in the direction I should go for creating a script for an feature service in a web map. I want to be able to change the symbology of the layer based upon what week it is. So the script would ideally switch from Week A to Week B every 7 days and the current week's polygon borders would be highlighted in red. Any advice would be greatly appreciated!
Solved! Go to Solution.
I'd possibly use the ISOWeek() Aracade method to check the numerical ISO 8601 week (week starts on Monday) of your date field value, and compare it against Now(). And have this as a symbology expression. Something like:
//does not account for dates in the future
if ( ISOWeek($feature.yourDateField) == ISOWeek(Now()) ) {
return 'ThisWeek'
else {
return 'NotThisWeek'
}
I'd possibly use the ISOWeek() Aracade method to check the numerical ISO 8601 week (week starts on Monday) of your date field value, and compare it against Now(). And have this as a symbology expression. Something like:
//does not account for dates in the future
if ( ISOWeek($feature.yourDateField) == ISOWeek(Now()) ) {
return 'ThisWeek'
else {
return 'NotThisWeek'
}
Hi @OliverSandoval ,
I've used a script almost identical to @DavidPike 's in his screenshot above. I used the documentation found here for reference if it helps, too: https://developers.arcgis.com/arcade/function-reference/date_functions/
Cheers 🙂
Hi @GIS_Fox thank you very much! Ill most definitely be using that! 😊!
Awesome thank you so much David for your response! Ill try it out!