Merge pull request #2121 from sdetweil/develop

fix full day recurring events not showing
This commit is contained in:
Michael Teeuw
2020-09-02 09:04:08 +02:00
committed by GitHub
2 changed files with 15 additions and 2 deletions

View File

@@ -202,8 +202,16 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
// 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 dates = rule.between(pastLocal, futureLocal, true, limitFunction);
// The "dates" array contains the set of dates within our desired date range range that are valid
@@ -232,6 +240,7 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn
const dateKey = date.toISOString().substring(0, 10);
let curEvent = event;
let showRecurrence = true;
let duration = 0;
startDate = moment(date);