improve ical

This commit is contained in:
Lorin Werthen 2017-02-08 17:05:48 +01:00
parent 57a1f53f31
commit 90a6374814
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
3 changed files with 10 additions and 4 deletions

View file

@ -3,6 +3,7 @@ title: Hashcode
description: Zeus organiseert een UGent Hashcode Hub
created_at: 27-01-2017
time: 23-02-2017 18:30
end: 23-02-2017 23:00
location: A3, S9
locationlink: Sterre,Ghent Belgium
banner: https://hashcode.withgoogle.com/resources/images/hero_2.jpg

View file

@ -10,10 +10,14 @@ module IcalHelper
end
def event_for(item)
event = Icalendar::Event.new
event.dtstart = item[:time]
event.summary = item[:title]
e = Icalendar::Event.new
e.dtstart = item[:time]
e.dtend = item[:end] if item[:end]
e.summary = item[:title]
e.description = item[:description] + "\n\n" + item.reps[:text].compiled_content
e.location = item[:location]
e.url = @config[:base_url] + item.path
event
e
end
end

View file

@ -39,6 +39,7 @@ module PreprocessHelper
def convert_event_time_to_timestamps
all_events.each do |event|
event[:time] = DateTime.parse(event[:time])
event[:end] = DateTime.parse(event[:end]) if event[:end]
end
end
end