Timezones are globally added to the ical export

remotes/origin/master
echarp 4 years ago
parent 999f947aa4
commit 6008770a9d
  1. 6
      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}"

Loading…
Cancel
Save