improve ical
This commit is contained in:
parent
57a1f53f31
commit
90a6374814
3 changed files with 10 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue