Merge pull request #2486 from sdetweil/fixdaylight

This commit is contained in:
Michael Teeuw 2021-03-17 13:52:20 +01:00 committed by GitHub
commit 2ec275957f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -59,6 +59,7 @@ _This release is scheduled to be released on 2021-04-01._
- Fix e2e tests after spectron update - Fix e2e tests after spectron update
- Fix updatenotification creating zombie processes by setting a timeout for the git process - Fix updatenotification creating zombie processes by setting a timeout for the git process
- Fix weather module openweathermap not loading if lat and lon set without onecall. - Fix weather module openweathermap not loading if lat and lon set without onecall.
- Fix calendar daylight savings offset calculation if recurring start date before 2007
## [2.14.0] - 2021-01-01 ## [2.14.0] - 2021-01-01

View File

@ -71,8 +71,13 @@ const CalendarUtils = {
Log.debug("adjusted date=" + event.start); Log.debug("adjusted date=" + event.start);
} else { } else {
// get the start time in that timezone // get the start time in that timezone
Log.debug("start date/time=" + moment(event.start).toDate()); let es = moment(event.start);
start_offset = moment.tz(moment(event.start), event.start.tz).utcOffset(); // check for start date prior to start of daylight changing date
if (es.format("YYYY") < 2007) {
es.set("year", 2013); // if so, use a closer date
}
Log.debug("start date/time=" + es.toDate());
start_offset = moment.tz(es, event.start.tz).utcOffset();
Log.debug("start offset=" + start_offset); Log.debug("start offset=" + start_offset);
Log.debug("start date/time w tz =" + moment.tz(moment(event.start), event.start.tz).toDate()); Log.debug("start date/time w tz =" + moment.tz(moment(event.start), event.start.tz).toDate());