From e2f9e707c3b66bf839442ea677c1db82ef0e8a34 Mon Sep 17 00:00:00 2001 From: echarp Date: Sat, 27 Apr 2019 15:39:06 +0200 Subject: [PATCH] Manage offset without a specific name --- app/views/events/index.ics.haml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/events/index.ics.haml b/app/views/events/index.ics.haml index f39491c6..9fd89dcb 100644 --- a/app/views/events/index.ics.haml +++ b/app/views/events/index.ics.haml @@ -5,9 +5,13 @@ cal = Icalendar::Calendar.new @events.each do |event| tzid = event.region.tzid - tz = TZInfo::Timezone.get tzid - timezone = tz.ical_timezone event.start_time - cal.add_timezone timezone + begin + tz = TZInfo::Timezone.get tzid + timezone = tz.ical_timezone event.start_time + cal.add_timezone timezone + rescue TZInfo::InvalidTimezoneIdentifier + # No need to add this tz + end cal.event do |e| e.dtstamp = Icalendar::Values::DateTime.new event.decision_time, tzid: tzid