From 8e9ee96696cfb714328285034e5813753fc13dc0 Mon Sep 17 00:00:00 2001 From: Joshua Kriegshauser Date: Wed, 25 Oct 2023 20:02:05 -0700 Subject: [PATCH] Fix issue #3250 --- modules/default/calendar/calendarfetcherutils.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/default/calendar/calendarfetcherutils.js b/modules/default/calendar/calendarfetcherutils.js index 34cc2578c6..3a90ae7ece 100644 --- a/modules/default/calendar/calendarfetcherutils.js +++ b/modules/default/calendar/calendarfetcherutils.js @@ -305,11 +305,6 @@ const CalendarFetcherUtils = { // Loop through the set of date entries to see which recurrences should be added to our event list. for (let d in dates) { let date = dates[d]; - // Remove the time information of each date by using its substring, using the following method: - // .toISOString().substring(0,10). - // since the date is given as ISOString with YYYY-MM-DDTHH:MM:SS.SSSZ - // (see https://momentjs.com/docs/#/displaying/as-iso-string/). - const dateKey = date.toISOString().substring(0, 10); let curEvent = event; let showRecurrence = true; @@ -402,6 +397,13 @@ const CalendarFetcherUtils = { let adjustDays = CalendarFetcherUtils.calculateTimezoneAdjustment(event, date); + // Remove the time information of each date by using its substring, using the following method: + // .toISOString().substring(0,10). + // since the date is given as ISOString with YYYY-MM-DDTHH:MM:SS.SSSZ + // (see https://momentjs.com/docs/#/displaying/as-iso-string/). + // This must be done after `date` is adjusted + const dateKey = date.toISOString().substring(0, 10); + // For each date that we're checking, it's possible that there is a recurrence override for that one day. if (curEvent.recurrences !== undefined && curEvent.recurrences[dateKey] !== undefined) { // We found an override, so for this recurrence, use a potentially different title, start date, and duration.