mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Merge pull request #2057 from wolfen351/wolfen351-patch-1
Correct calendar display - account for current timezone
This commit is contained in:
commit
ca8acb14f1
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user