apply "Fix incorrect timezone specification for some events (UTC instead of CET)" by octycs from upstream

This commit is contained in:
Jan Koppe 2020-12-24 12:59:12 +00:00
parent bf5d375274
commit 0257d66050
1 changed files with 8 additions and 1 deletions

View File

@ -128,7 +128,14 @@ def events(scheduleUrl, titlemap={}):
if __name__ == "__main__": if __name__ == "__main__":
events = events(scheduleUrl) events = list(events(scheduleUrl))
# FIX: Some events have an incorrectly specified timezone (UTC instead of CET)
for ev in events:
if ev['datetime'].endswith("+00:00"):
ev['datetime'] = ev['datetime'].replace("+00:00", "+01:00")
print(f"Warning: Assuming CET instead of UTC for event '{ev['title']}': {ev['datetime']}")
events = sorted(events, key=lambda x: datetime.datetime.fromisoformat(x["datetime"])) events = sorted(events, key=lambda x: datetime.datetime.fromisoformat(x["datetime"]))
# Filter already passed events # Filter already passed events