Fix vulcan calendar offset (#113604)

* Fix offset on vulcan calendar

* Combine date, time and zone into one command in vulcan calendar
pull/113627/head
Antoni Czaplicki 2024-03-16 21:59:24 +01:00 committed by GitHub
parent 7d58be1a6a
commit cbe2a5883b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -111,11 +111,11 @@ class VulcanCalendarEntity(CalendarEntity):
event_list = []
for item in events:
event = CalendarEvent(
start=datetime.combine(item["date"], item["time"].from_).astimezone(
ZoneInfo("Europe/Warsaw")
start=datetime.combine(
item["date"], item["time"].from_, ZoneInfo("Europe/Warsaw")
),
end=datetime.combine(item["date"], item["time"].to).astimezone(
ZoneInfo("Europe/Warsaw")
end=datetime.combine(
item["date"], item["time"].to, ZoneInfo("Europe/Warsaw")
),
summary=item["lesson"],
location=item["room"],
@ -165,10 +165,10 @@ class VulcanCalendarEntity(CalendarEntity):
)
self._event = CalendarEvent(
start=datetime.combine(
new_event["date"], new_event["time"].from_
).astimezone(ZoneInfo("Europe/Warsaw")),
end=datetime.combine(new_event["date"], new_event["time"].to).astimezone(
ZoneInfo("Europe/Warsaw")
new_event["date"], new_event["time"].from_, ZoneInfo("Europe/Warsaw")
),
end=datetime.combine(
new_event["date"], new_event["time"].to, ZoneInfo("Europe/Warsaw")
),
summary=new_event["lesson"],
location=new_event["room"],