From c0b431073600b1b7a7530adf2b5336195a76ef1c Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Tue, 21 Jan 2025 14:56:53 -0500 Subject: [PATCH] Fix duplicate shifts on mobile views If the calendar loaded the listWeek view by default, which it does on mobile, it was then switching the date for the calendar immediately after -- this was causing events to appear in the list twice. We now initialize the right start date for the listWeek view to stop this from happening. --- uber/templates/staffing/shifts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uber/templates/staffing/shifts.html b/uber/templates/staffing/shifts.html index b47bd922b..c53129202 100644 --- a/uber/templates/staffing/shifts.html +++ b/uber/templates/staffing/shifts.html @@ -598,7 +598,7 @@

const ec = new EventCalendar(document.getElementById('shift_cal'), { view: window.matchMedia('(max-width: 576px)').matches ? 'listWeek' : 'timeGridWeek', - date: '{{ c.EPOCH.date() }}', + date: window.matchMedia('(max-width: 576px)').matches ? '{{ start }}' : '{{ c.EPOCH.date() }}', allDaySlot: false, highlightedDates: {{ highlighted_dates|safe }}, headerToolbar: {