From b4da93e4f0d34ef19633b4f77ddaacd0a7be2380 Mon Sep 17 00:00:00 2001 From: Louis King Date: Mon, 9 Feb 2026 00:43:51 +0000 Subject: [PATCH] Move timezone display to page headers instead of each timestamp - Remove timezone abbreviation from datetime format strings - Add timezone label to page headers (Nodes, Messages, Advertisements, Map) - Only show timezone when not UTC to reduce clutter Co-Authored-By: Claude Opus 4.5 --- src/meshcore_hub/web/app.py | 8 ++++---- src/meshcore_hub/web/templates/advertisements.html | 5 ++++- src/meshcore_hub/web/templates/map.html | 1 + src/meshcore_hub/web/templates/messages.html | 5 ++++- src/meshcore_hub/web/templates/nodes.html | 5 ++++- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/meshcore_hub/web/app.py b/src/meshcore_hub/web/app.py index 669c6a6..292aa3a 100644 --- a/src/meshcore_hub/web/app.py +++ b/src/meshcore_hub/web/app.py @@ -44,7 +44,7 @@ def _create_timezone_filters(tz_name: str) -> dict: def format_datetime( value: str | datetime | None, - fmt: str = "%Y-%m-%d %H:%M:%S %Z", + fmt: str = "%Y-%m-%d %H:%M:%S", ) -> str: """Format a UTC datetime string or object to the configured timezone. @@ -79,7 +79,7 @@ def _create_timezone_filters(tz_name: str) -> dict: # Fallback to original value if parsing fails return str(value)[:19].replace("T", " ") if value else "-" - def format_time(value: str | datetime | None, fmt: str = "%H:%M:%S %Z") -> str: + def format_time(value: str | datetime | None, fmt: str = "%H:%M:%S") -> str: """Format just the time portion in the configured timezone.""" return format_datetime(value, fmt) @@ -89,10 +89,10 @@ def _create_timezone_filters(tz_name: str) -> dict: return { "localtime": format_datetime, - "localtime_short": lambda v: format_datetime(v, "%Y-%m-%d %H:%M %Z"), + "localtime_short": lambda v: format_datetime(v, "%Y-%m-%d %H:%M"), "localdate": format_date, "localtimeonly": format_time, - "localtimeonly_short": lambda v: format_time(v, "%H:%M %Z"), + "localtimeonly_short": lambda v: format_time(v, "%H:%M"), } diff --git a/src/meshcore_hub/web/templates/advertisements.html b/src/meshcore_hub/web/templates/advertisements.html index 72bd04d..4e6737d 100644 --- a/src/meshcore_hub/web/templates/advertisements.html +++ b/src/meshcore_hub/web/templates/advertisements.html @@ -7,7 +7,10 @@ {% block content %}

Advertisements

- {{ total }} total +
+ {% if timezone and timezone != 'UTC' %}{{ timezone }}{% endif %} + {{ total }} total +
{% if api_error %} diff --git a/src/meshcore_hub/web/templates/map.html b/src/meshcore_hub/web/templates/map.html index 47e7149..5463c92 100644 --- a/src/meshcore_hub/web/templates/map.html +++ b/src/meshcore_hub/web/templates/map.html @@ -6,6 +6,7 @@

Map

+ {% if timezone and timezone != 'UTC' %}{{ timezone }}{% endif %} Loading...
diff --git a/src/meshcore_hub/web/templates/messages.html b/src/meshcore_hub/web/templates/messages.html index afd74ef..882928e 100644 --- a/src/meshcore_hub/web/templates/messages.html +++ b/src/meshcore_hub/web/templates/messages.html @@ -7,7 +7,10 @@ {% block content %}

Messages

- {{ total }} total +
+ {% if timezone and timezone != 'UTC' %}{{ timezone }}{% endif %} + {{ total }} total +
{% if api_error %} diff --git a/src/meshcore_hub/web/templates/nodes.html b/src/meshcore_hub/web/templates/nodes.html index b415715..878b984 100644 --- a/src/meshcore_hub/web/templates/nodes.html +++ b/src/meshcore_hub/web/templates/nodes.html @@ -7,7 +7,10 @@ {% block content %}

Nodes

- {{ total }} total +
+ {% if timezone and timezone != 'UTC' %}{{ timezone }}{% endif %} + {{ total }} total +
{% if api_error %}