agenda-libre-ruby/app/views/events/index.ics.haml

19 lines
596 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:ruby
# Create a calendar with an event (standard method)
cal = Icalendar::Calendar.new
@events.each do |event|
cal.event do |e|
e.dtstamp = Icalendar::Values::DateTime.new event.decision_time
e.uid = "#{event.id}@#{request.domain}"
e.dtstart = Icalendar::Values::DateTime.new event.start_time
e.dtend = Icalendar::Values::DateTime.new event.end_time
e.summary = event.title
e.description = event.description.tr '\'', ''
e.location = event.full_address.tr '\'', ''
end
end
cal.publish
= cal.to_ical