Fix possible timezone issue in Trafikverket Train (#170595)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: joostlek <7083755+joostlek@users.noreply.github.com>
This commit is contained in:
G Johansson
2026-05-14 16:17:19 +02:00
committed by GitHub
parent b62b8a0f3f
commit eb45c35952
@@ -3,6 +3,7 @@
from datetime import date, timedelta
from homeassistant.const import WEEKDAYS
from homeassistant.util import dt as dt_util
def next_weekday(fromdate: date, weekday: int) -> date:
@@ -15,7 +16,7 @@ def next_weekday(fromdate: date, weekday: int) -> date:
def next_departuredate(departure: list[str]) -> date:
"""Calculate the next departuredate from an array input of short days."""
today_date = date.today() # noqa: DTZ011
today_date = dt_util.now().date()
today_weekday = date.weekday(today_date)
if WEEKDAYS[today_weekday] in departure:
return today_date