Attempt to remove all timezone info from ics and rss feeds

This commit is contained in:
echarp 2018-03-27 23:30:21 +02:00
parent 9fbf119d08
commit 5e6d4778a8
4 changed files with 7 additions and 9 deletions

View File

@ -3,11 +3,10 @@ VERSION:2.0
PRODID:-//AgendaDuLibre.org PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %> X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %>
X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %> X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %>
X-WR-TIMEZONE:<%= Time.now.zone %>
<% @events.find_each do |event| %> <% @events.find_each do |event| %>
BEGIN:VEVENT BEGIN:VEVENT
DTSTART;TZID=<%= Time.now.zone %>:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %> DTSTART;<%= 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' %> DTEND;<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title.gsub(',', '\,').gsub(';', '\;') %> SUMMARY:<%= event.title.gsub(',', '\,').gsub(';', '\;') %>
URL:<%= event_url event %> URL:<%= event_url event %>

View File

@ -1,7 +1,7 @@
def meta(xml, event) def meta(xml, event)
domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '') domain = root_url.gsub(/www/, '').gsub(/http.?:../, '').gsub(/:.*/, '')
xml.dc :identifier, "#{event.id}@#{domain}" xml.dc :identifier, "#{event.id}@#{domain}"
xml.dc :date, event.start_time.iso8601 xml.dc :date, l(event.start_time, format: :xml)
return unless event.latitude || event.longitude return unless event.latitude || event.longitude
xml.georss :point, event.latitude, ' ', event.longitude xml.georss :point, event.latitude, ' ', event.longitude

View File

@ -4,8 +4,8 @@ xml.events do
@events.find_each do |event| @events.find_each do |event|
xml.event do xml.event do
xml.title event.title xml.title event.title
xml.tag! 'start-time', l(event.start_time, format: 'xml') xml.tag! 'start-time', l(event.start_time, format: :xml)
xml.tag! 'end-time', l(event.end_time, format: 'xml') xml.tag! 'end-time', l(event.end_time, format: :xml)
xml.place_name event.place_name xml.place_name event.place_name
xml.address event.address xml.address event.address
xml.city event.city xml.city event.city

View File

@ -3,11 +3,10 @@ VERSION:2.0
PRODID:-//AgendaDuLibre.org PRODID:-//AgendaDuLibre.org
X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %> X-WR-CALNAME:<%= t('title', scope: [:layouts, :application]).gsub(/'/, '') %>
X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %> X-WR-CALDESC:<%= t 'subtitle', scope: [:layouts, :application] %>
X-WR-TIMEZONE:<%= Time.now.zone %>
<% event = @event %> <% event = @event %>
BEGIN:VEVENT BEGIN:VEVENT
DTSTART;TZID=<%= Time.now.zone %>:<%= event.start_time.strftime '%Y%m%dT%H%M%S' %> DTSTART;<%= 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' %> DTEND;<%= event.end_time.strftime '%Y%m%dT%H%M%S' %>
UID:<%= event.id %>@agendadulibre.org UID:<%= event.id %>@agendadulibre.org
SUMMARY:<%= event.title %> SUMMARY:<%= event.title %>
URL:<%= event_url event %> URL:<%= event_url event %>