From d5caadd9062ae7ee6dcdfe25caa4c435d01c82ea Mon Sep 17 00:00:00 2001 From: wolfen351 Date: Sat, 27 Jun 2020 19:43:09 +1200 Subject: [PATCH 1/2] Correct calendar display - account for current timezone --- modules/default/calendar/calendar.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index d93f570c..97eca85f 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -469,6 +469,12 @@ Module.register("calendar", { var calendar = this.calendarData[c]; for (var e in calendar) { var event = JSON.parse(JSON.stringify(calendar[e])); // clone object + + // correct data for the current timezone + var offset = - ((new Date()).getTimezoneOffset() * 60 * 1000); + event.startDate = (event.startDate - offset); + event.endDate = (event.endDate - offset); + if(event.endDate < now) { continue; } From a06615355625fea82deae86f36d061ecf1521679 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 4 Jul 2020 21:26:22 +0200 Subject: [PATCH 2/2] Add updated changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66c307c3..1e38f0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ _This release is scheduled to be released on 2020-10-01._ ### Fixed - Fix the use of "maxNumberOfDays" in the module "weatherforecast depending on the endpoint (forecast/daily or forecast)". [#2018](https://github.com/MichMich/MagicMirror/issues/2018) +- Fix calendar display. Account for current timezone. [#2068](https://github.com/MichMich/MagicMirror/issues/2068) ## [2.12.0] - 2020-07-01