diff --git a/fahrplan.py b/fahrplan.py index 1414def..127eca4 100644 --- a/fahrplan.py +++ b/fahrplan.py @@ -128,7 +128,14 @@ def events(scheduleUrl, titlemap={}): 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"])) # Filter already passed events