Manage offset without a specific name

remotes/origin/master
echarp 4 years ago
parent 6008770a9d
commit e2f9e707c3
  1. 10
      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

Loading…
Cancel
Save