fix two timezone select bugs (#756)

* fix automatic reloading when changing from timezone to automatic

Signed-off-by: Georg Ehrke <developer@georgehrke.com>

* we need to convert UTC now as well, as people can select a timezone that does not necessarily match their browsers utc offset

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2018-03-06 13:23:20 +01:00 committed by GitHub
parent 6fc53220ee
commit fa87083cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -67,7 +67,12 @@ app.controller('SettingsController', ['$scope', '$uibModal', '$timeout', 'Timezo
settings.timezone = $scope.timezone;
if (fc.elm) {
fc.elm.fullCalendar('option', 'timezone', settings.timezone);
let timezone = settings.timezone;
if (settings.timezone === 'automatic') {
timezone = TimezoneService.getDetected();
}
fc.elm.fullCalendar('option', 'timezone', timezone);
}
};

View File

@ -109,7 +109,6 @@ app.factory('VEvent', function(TimezoneService, FcEvent, SimpleEvent, ICalFactor
*/
context.needsTzConversion = function(dt) {
return (dt.icaltype !== 'date' &&
dt.zone !== ICAL.Timezone.utcTimezone &&
dt.zone !== ICAL.Timezone.localTimezone);
};