diff --git a/Rules b/Rules index 72bda818..211bc92d 100644 --- a/Rules +++ b/Rules @@ -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 diff --git a/lib/eventhelpers.rb b/lib/eventhelpers.rb index 38af752a..7fa1fa2c 100644 --- a/lib/eventhelpers.rb +++ b/lib/eventhelpers.rb @@ -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