Select to view content in your preferred language

My Trash Services solution Arcade Calendar Issue for Bi-Weekly Pickup

68
0
Wednesday
aolson
by
New Contributor

Hello, I am working with the current ESRI Solution for My Trash Services. We are in the process of launching the Curbside Service Schedules web map for our city. We are having trouble with the Arcade expression in the web map that displays a Calendar in a popup for the recycling pickup days.

City recycling pickups are made in different districts across the city on every day of the week Mon-Fri, then repeat pickup in 2 weeks (bi-weekly). The current Arcade expression will show the correct pickup days in a popup with the correct 'every-other' interval only when the first week of the month contains the day of the first pickup, for example Tuesday. In months where the first week does not have a Tuesday, the pickup is shifted forward and the cycle of pickups becomes out of sync.

Here is an example of how the problem is appearing on the calendar popup for this month (April) and next month (May). Green boxes on the calendar are the pickup days displayed by the current Arcade script:

1. The 'every-other week' cycle is correct for Tuesday pickups in April. The month of April starts on a Tuesday and the last pickup is the 29th

2. The 'every-other week' cycle is wrong for Tuesday pickups in May because May starts on a Thursday. The cadence is broken for Tuesday pickups in May.

Calendar_issue.png

Is there a way to modify the Arcade script to recognize the pickup days that occurred in the previous month so that the 'every-other' cycle remains consistent? If the last pickup was April 29th, the next pickup will be May 13th. This is the desired result:

desired_result.png

I have attached a copy of the trash services Arcade script that we are working with. The only variable we changed is the pickupWeekInterval:

/*If pickup occurs weekly, specify 1. 
If every other week specify 2, etc.*/
var pickupWeekInterval = 2;


 

0 Kudos
0 Replies