Merge branch 'develop' into pr/bryanzzhu/2060

This commit is contained in:
Michael Teeuw 2020-07-04 21:38:29 +02:00
commit 8b30634ebe
2 changed files with 7 additions and 0 deletions

View File

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

View File

@ -467,6 +467,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;
}