diff --git a/CHANGELOG.md b/CHANGELOG.md index 469c8074..b30f02fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](https://semver.org/). ❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² +### fixed + +- 2110, 2111, 2118 recurring full day events should not use timezone adjustment. just compare month/day + ## [2.13.0] - Unreleased (Develop Branch - Please add your contributions to this release.) _This release is scheduled to be released on 2020-10-01._ diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 033f73cb..a67dc99b 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -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);