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
commit 15c3f11f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -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._

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);