mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 12:39:45 +00:00
Correct calendar display - account for current timezone
This commit is contained in:
parent
447c0bffdc
commit
d5caadd906
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user