Fix timezones

This commit is contained in:
Stefan Schlott 2013-08-27 19:21:33 +02:00
parent 1341647c2a
commit a405b48712
2 changed files with 14 additions and 0 deletions

1
Rules
View file

@ -4,6 +4,7 @@ preprocess do
expand_event_list("/_data/chaosevents/")
expand_event_list("/_data/stammtisch/", "CCCS Stammtisch")
calculate_to_dates
fix_timezones
merge_location_data
generate_event_pages
generate_activity_pages

View file

@ -41,3 +41,16 @@ def calculate_to_dates()
end
end
def fix_timezones()
items.each do |e|
if e[:created_at] && e[:created_at].instance_of?(Time)
e[:created_at] = e[:created_at].utc
end
if e[:startdate] && e[:startdate].instance_of?(Time)
e[:startdate] = e[:startdate].utc
end
if e[:enddate] && e[:enddate].instance_of?(Time)
e[:enddate] = e[:enddate].utc
end
end
end