diff --git a/apps/calendar/interface.html b/apps/calendar/interface.html index 71b9a153c..8fa624a40 100644 --- a/apps/calendar/interface.html +++ b/apps/calendar/interface.html @@ -32,12 +32,14 @@ function readFile(input) { const jCalData = ICAL.parse(icalText); const comp = new ICAL.Component(jCalData); const vtz = comp.getFirstSubcomponent('vtimezone'); - const tz = new ICAL.Timezone(vtz); + const tz = vtz != null ? new ICAL.Timezone(vtz) : null; // Fetch the VEVENT part comp.getAllSubcomponents('vevent').forEach(vevent => { const event = new ICAL.Event(vevent); - event.startDate.zone = tz; + if (tz != null) { + event.startDate.zone = tz; + } holidays = holidays.filter(holiday => !sameDay(new Date(holiday.date), event.startDate.toJSDate())); // remove if already exists const holiday = eventToHoliday(event); diff --git a/apps/sched/interface.html b/apps/sched/interface.html index 68547aa7e..62e45676b 100644 --- a/apps/sched/interface.html +++ b/apps/sched/interface.html @@ -20,7 +20,7 @@ function readFile(input) { const jCalData = ICAL.parse(icalText); const comp = new ICAL.Component(jCalData); const vtz = comp.getFirstSubcomponent('vtimezone'); - const tz = new ICAL.Timezone(vtz); + const tz = vtz != null ? new ICAL.Timezone(vtz) : null; // Fetch the VEVENT part comp.getAllSubcomponents('vevent').forEach(vevent => { @@ -73,7 +73,9 @@ function getAlarmDefaults() { } function eventToAlarm(event, tz, offsetMs) { - event.startDate.zone = tz; + if (tz != null) { + event.startDate.zone = tz; + } const dateOrig = event.startDate.toJSDate(); const date = offsetMs ? new Date(dateOrig - offsetMs) : dateOrig;