modified: __pycache__/app.cpython-310.pyc

modified:   app.py
	modified:   static/css/style.css
	modified:   templates/weather.html
This commit is contained in:
SimolZimol
2026-04-21 09:39:05 +02:00
parent fc456ae2ac
commit 71337bb552
4 changed files with 15 additions and 4 deletions

11
app.py
View File

@@ -202,13 +202,17 @@ def wetter():
# "Aktuell" = erste Stunde >= jetzt (UTC), sonst erste verfügbare
now_utc = _dt.datetime.now(_dt.timezone.utc).replace(tzinfo=None)
current = forecast[0]
for h in forecast:
now_local = _dt.datetime.now() # lokale Serverzeit für Anzeige
current_idx = 0
for i, h in enumerate(forecast):
dt = h["datetime"]
dt_naive = dt.replace(tzinfo=None) if hasattr(dt, "tzinfo") and dt.tzinfo is not None else dt
if dt_naive >= now_utc:
current = h
current_idx = i
break
current = forecast[current_idx]
# Stundenliste ab jetzt kürzen
forecast = forecast[current_idx:]
# Tageszusammenfassung
daily = {}
@@ -262,6 +266,7 @@ def wetter():
station_id=station_id,
station_dist=station_dist,
current=current,
now_local=now_local.strftime("%H:%M"),
forecast=forecast[:48],
daily=daily_summary,
chart_labels=chart_labels,