From 8ce37d53cd8a452c3098b58be7126861b6d8d180 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Tue, 1 Sep 2020 14:04:35 +0100 Subject: [PATCH] fix recurring full date events --- modules/default/calendar/calendarfetcher.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 4a6fb0e6..f320fbcd 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -184,8 +184,17 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumNu // For recurring events, get the set of start dates that fall within the range // of dates we're looking for. // kblankenship1989 - to fix issue #1798, converting all dates to locale time first, then converting back to UTC time - const pastLocal = pastMoment.subtract(past.getTimezoneOffset(), "minutes").toDate(); - const futureLocal = futureMoment.subtract(future.getTimezoneOffset(), "minutes").toDate(); + let pastLocal = 0 + let futureLocal = 0 + if(isFullDayEvent(event)){ + // if full day event, only use the date part of the ranges + pastLocal = pastMoment.toDate(); + futureLocal = futureMoment.toDate() + } + else { + pastLocal = pastMoment.subtract(past.getTimezoneOffset(), "minutes").toDate(); + futureLocal = futureMoment.subtract(future.getTimezoneOffset(), "minutes").toDate(); + } const datesLocal = rule.between(pastLocal, futureLocal, true, limitFunction); const dates = datesLocal.map(function (dateLocal) { return moment(dateLocal).add(dateLocal.getTimezoneOffset(), "minutes").toDate(); @@ -217,6 +226,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumNu const dateKey = date.toISOString().substring(0, 10); let curEvent = event; let showRecurrence = true; + let duration = 0; startDate = moment(date);