mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-25 23:55:07 +00:00
Merge pull request #2121 from sdetweil/develop
fix full day recurring events not showing
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user