Correct calendar display - account for current timezone

This commit is contained in:
wolfen351 2020-06-27 19:43:09 +12:00 committed by GitHub
parent 447c0bffdc
commit d5caadd906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -469,6 +469,12 @@ Module.register("calendar", {
var calendar = this.calendarData[c]; var calendar = this.calendarData[c];
for (var e in calendar) { for (var e in calendar) {
var event = JSON.parse(JSON.stringify(calendar[e])); // clone object 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) { if(event.endDate < now) {
continue; continue;
} }