summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/get_calendar.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/get_calendar.py b/scripts/get_calendar.py
index ee1674b..2fb12a7 100644
--- a/scripts/get_calendar.py
+++ b/scripts/get_calendar.py
@@ -1,5 +1,6 @@
from datetime import datetime, timedelta, time, date
from dateutil.relativedelta import relativedelta
+from dateutil import tz
import urllib2
import json
@@ -84,6 +85,10 @@ def get_events(calendar, after, before):
end = datetime.combine(end, time())
if end.hour == 0 and end.minute == 0 and end.second == 0:
end -= timedelta(seconds=1)
+ if start.tzinfo is not None:
+ start = start.astimezone(berlin).replace(tzinfo=None)
+ if end.tzinfo is not None:
+ end = end.astimezone(berlin).replace(tzinfo=None)
if 'rrule' in event:
rrule = rrulestr(event['rrule'].to_ical(), dtstart=start)