diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index bf6f1a2..6370fb7 100644 Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ diff --git a/app.py b/app.py index 24d3f5c..31c0ee1 100644 --- a/app.py +++ b/app.py @@ -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, diff --git a/static/css/style.css b/static/css/style.css index 7a4998b..e7e398a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -278,6 +278,10 @@ main { flex: 1; } } .hero-meta svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--orange); } .hero-meta-sub { color: var(--muted); font-weight: 400; } +.hero-meta-time { + margin-left: auto; font-variant-numeric: tabular-nums; + color: var(--orange); font-weight: 600; letter-spacing: 0.04em; +} .hero-main { display: flex; align-items: flex-start; gap: 2rem; diff --git a/templates/weather.html b/templates/weather.html index e460f57..46419fc 100644 --- a/templates/weather.html +++ b/templates/weather.html @@ -21,6 +21,7 @@ {{ display_name.split(',')[0] }} +