Finally fix timezone desaster
All UTC times will be converted to local time. No need for tzinfo, etc. Bear in mind to use UTC times in events for simplified input!
This commit is contained in:
parent
086991118f
commit
e94ddcb4ca
14 changed files with 21 additions and 24 deletions
2
Gemfile
2
Gemfile
|
|
@ -12,6 +12,4 @@ gem 't'
|
|||
gem 'nokogiri'
|
||||
gem 'feedzirra'
|
||||
gem 'ri_cal'
|
||||
gem 'tzinfo'
|
||||
gem 'tzinfo-data'
|
||||
|
||||
|
|
|
|||
|
|
@ -123,9 +123,6 @@ GEM
|
|||
faraday (~> 0.8, < 0.10)
|
||||
multi_json (~> 1.0)
|
||||
simple_oauth (~> 0.2)
|
||||
tzinfo (1.0.1)
|
||||
tzinfo-data (1.2013.4)
|
||||
tzinfo (>= 1.0.0)
|
||||
yajl-ruby (1.1.0)
|
||||
|
||||
PLATFORMS
|
||||
|
|
@ -143,5 +140,3 @@ DEPENDENCIES
|
|||
sass
|
||||
systemu
|
||||
t
|
||||
tzinfo
|
||||
tzinfo-data
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2007-05-10T19:30:00
|
||||
startdate: 2007-05-10T19:30:00Z
|
||||
duration: 2h
|
||||
title: "DNS & Domainvergabe - wie geht das eigentlich"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-01-10T19:30:00
|
||||
startdate: 2013-01-10T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Fahrrad-Illumination: heller als die Polizei erlaubt"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-02-14T19:30:00
|
||||
startdate: 2013-02-14T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Über die besonderen Anforderungen beim Sammeln von historischen Großrechnern"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-03-14T19:30:00
|
||||
startdate: 2013-03-14T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Pretty Easy Privacy - Chat"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-04-11T19:30:00
|
||||
startdate: 2013-04-11T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Bericht aus der Internet-Enquête-Kommision"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-05-16T19:30:00
|
||||
startdate: 2013-05-16T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Frauen in der Informatik und ihre Arbeitsbedingungen"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-07-11T19:30:00
|
||||
startdate: 2013-07-11T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Der Facebook-Hack - Erlebnisse bei strafrechtliche Ermittlungen in Sozialen Netzwerken oder Festplatten zu beschlagnahmen"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-08-15T19:30:00
|
||||
startdate: 2013-08-15T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Datenschutz in Unternehmen und Organisationen - Bewertung in unterschiedlichen Kontexten"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-09-12T19:30:00
|
||||
startdate: 2013-09-12T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Prism, Tempora und Co. - Wie wir überwacht werden und wie wir uns verteidigen können"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
kind: event
|
||||
startdate: 2013-11-14T19:30:00
|
||||
startdate: 2013-11-14T19:30:00Z
|
||||
duration: 2h
|
||||
title: "Wenn Schiller die Räuber mit Wordstar geschrieben hätte - digitale Langzeitarchivierung am Deutschen Literaturarchiv Marbach"
|
||||
speakers:
|
||||
|
|
|
|||
|
|
@ -41,16 +41,24 @@ def calculate_to_dates()
|
|||
end
|
||||
end
|
||||
|
||||
def conv_tz(t)
|
||||
if (t.utc?)
|
||||
Time.local(t.year, t.month, t.day, t.hour, t.min, t.sec)
|
||||
else
|
||||
t
|
||||
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
|
||||
e[:created_at] = conv_tz(e[:created_at])
|
||||
end
|
||||
if e[:startdate] && e[:startdate].instance_of?(Time)
|
||||
e[:startdate] = e[:startdate].utc
|
||||
e[:startdate] = conv_tz(e[:startdate])
|
||||
end
|
||||
if e[:enddate] && e[:enddate].instance_of?(Time)
|
||||
e[:enddate] = e[:enddate].utc
|
||||
e[:enddate] = conv_tz(e[:enddate])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,14 +2,10 @@
|
|||
# encoding: utf-8
|
||||
|
||||
require 'date'
|
||||
require 'tzinfo'
|
||||
require 'yaml'
|
||||
|
||||
|
||||
def event(day, dayoffset, location)
|
||||
#startDate = Time.new(day.year, day.month, day.day + dayoffset, 18, 0, 0, "+02:00")
|
||||
#tz = TZInfo::Timezone.get('Europe/Berlin')
|
||||
#startDate = tz.local_to_utc(Time.local(day.year, day.month, day.day + dayoffset, 18, 0, 0))
|
||||
startDate = Time.local(day.year, day.month, day.day + dayoffset, 18, 0, 0)
|
||||
{
|
||||
'startdate' => startDate,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue