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
|
description: Zeus organiseert een UGent Hashcode Hub
|
||||||
created_at: 27-01-2017
|
created_at: 27-01-2017
|
||||||
time: 23-02-2017 18:30
|
time: 23-02-2017 18:30
|
||||||
|
end: 23-02-2017 23:00
|
||||||
location: A3, S9
|
location: A3, S9
|
||||||
locationlink: Sterre,Ghent Belgium
|
locationlink: Sterre,Ghent Belgium
|
||||||
banner: https://hashcode.withgoogle.com/resources/images/hero_2.jpg
|
banner: https://hashcode.withgoogle.com/resources/images/hero_2.jpg
|
||||||
|
|
|
@ -10,10 +10,14 @@ module IcalHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def event_for(item)
|
def event_for(item)
|
||||||
event = Icalendar::Event.new
|
e = Icalendar::Event.new
|
||||||
event.dtstart = item[:time]
|
e.dtstart = item[:time]
|
||||||
event.summary = item[:title]
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,6 +39,7 @@ module PreprocessHelper
|
||||||
def convert_event_time_to_timestamps
|
def convert_event_time_to_timestamps
|
||||||
all_events.each do |event|
|
all_events.each do |event|
|
||||||
event[:time] = DateTime.parse(event[:time])
|
event[:time] = DateTime.parse(event[:time])
|
||||||
|
event[:end] = DateTime.parse(event[:end]) if event[:end]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue