From ea9ba4f559843a1d6d9cd1995aacad7502e915c0 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Wed, 8 Feb 2017 17:44:20 +0100 Subject: [PATCH] timezone --- lib/helpers/ical.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/helpers/ical.rb b/lib/helpers/ical.rb index 446fb62..3c3b880 100644 --- a/lib/helpers/ical.rb +++ b/lib/helpers/ical.rb @@ -10,9 +10,11 @@ module IcalHelper end def event_for(item) + tzid = 'Europe/Brussels' + e = Icalendar::Event.new - e.dtstart = item[:time] - e.dtend = item[:end] if item[:end] + e.dtstart = Icalendar::Values::DateTime.new item[:time], 'tzid' => tzid + e.dtend = Icalendar::Values::DateTime.new item[:end], 'tzid' => tzid if item[:end] e.summary = item[:title] e.description = item[:description] + "\n\n" + item.reps[:text].compiled_content e.location = item[:location]