15 lines
424 B
Plaintext
15 lines
424 B
Plaintext
:ruby
|
||
# Create a calendar with an event (standard method)
|
||
cal = Icalendar::Calendar.new
|
||
cal.event do |e|
|
||
e.dtstart = Icalendar::Values::DateTime.new @event.start_time
|
||
e.dtend = Icalendar::Values::DateTime.new @event.end_time
|
||
e.summary = @event.title
|
||
e.description = strip_tags(@event.description).tr '\'', '’'
|
||
e.location = @event.full_address
|
||
end
|
||
|
||
cal.publish
|
||
|
||
= cal.to_ical
|