From 6008770a9d105497217cc7d665b885a40afb1e49 Mon Sep 17 00:00:00 2001 From: echarp Date: Sat, 27 Apr 2019 15:12:42 +0200 Subject: [PATCH] Timezones are globally added to the ical export --- app/views/events/index.ics.haml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/events/index.ics.haml b/app/views/events/index.ics.haml index 08b6b7ff..f39491c6 100644 --- a/app/views/events/index.ics.haml +++ b/app/views/events/index.ics.haml @@ -1,8 +1,14 @@ :ruby + require 'icalendar/tzinfo' + # Create a calendar with an event (standard method) 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 + cal.event do |e| e.dtstamp = Icalendar::Values::DateTime.new event.decision_time, tzid: tzid e.uid = "#{event.id}@#{request.domain}"