agenda-libre-ruby/app/views/events/index.ics.erb
echarp eb46eb92ef The ics timezone now should be using the server setting.
Hopefully, this should be the good one in quebec or brasil!

(testing and feedback would be great)

Closes #76
2018-03-17 17:21:26 +01:00

19 lines
771 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.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %>
X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %>
X-WR-TIMEZONE:<%= Time.now.zone %>
<% @events.find_each do |event| %>
BEGIN:VEVENT
DTSTART;TZID=<%= Time.now.zone %>:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %>
DTEND;TZID=<%= Time.now.zone %>:<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title.gsub(',', '\,').gsub(';', '\;') %>
URL:<%= event_url event %>
DESCRIPTION:<%= strip_tags(event.description).gsub(/'/, '').gsub(',', '\,').gsub(';', '\;').gsub(/^/, ' ') %>
LOCATION:<%= event.full_address.gsub(/,/, '\,') %>
END:VEVENT
<% end %>
END:VCALENDAR