From 2a12b5f6ed874f2cc699890c593eb35f2cdb2b14 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 20 Apr 2021 16:50:47 +0200 Subject: [PATCH] Fix timezone errors on import --- www/calendar/export.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/calendar/export.js b/www/calendar/export.js index 7eb70e4de..64775762b 100644 --- a/www/calendar/export.js +++ b/www/calendar/export.js @@ -129,6 +129,15 @@ define([ //var method = vcalendar.getFirstPropertyValue('method'); //if (method !== "PUBLISH") { return void cb('NOT_SUPPORTED'); } + // Add all timezones in iCalendar object to TimezoneService + // if they are not already registered. + var timezones = vcalendar.getAllSubcomponents("vtimezone"); + timezones.forEach(function (timezone) { + if (!(ICAL.TimezoneService.has(timezone.getFirstPropertyValue("tzid")))) { + ICAL.TimezoneService.register(timezone); + } + }); + var events = vcalendar.getAllSubcomponents('vevent'); events.forEach(function (ev) { var uid = ev.getFirstPropertyValue('uid');