Skip to content

Commit b4da93e

Browse files
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 <noreply@anthropic.com>
1 parent 7671717 commit b4da93e

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

src/meshcore_hub/web/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _create_timezone_filters(tz_name: str) -> dict:
4444

4545
def format_datetime(
4646
value: str | datetime | None,
47-
fmt: str = "%Y-%m-%d %H:%M:%S %Z",
47+
fmt: str = "%Y-%m-%d %H:%M:%S",
4848
) -> str:
4949
"""Format a UTC datetime string or object to the configured timezone.
5050
@@ -79,7 +79,7 @@ def format_datetime(
7979
# Fallback to original value if parsing fails
8080
return str(value)[:19].replace("T", " ") if value else "-"
8181

82-
def format_time(value: str | datetime | None, fmt: str = "%H:%M:%S %Z") -> str:
82+
def format_time(value: str | datetime | None, fmt: str = "%H:%M:%S") -> str:
8383
"""Format just the time portion in the configured timezone."""
8484
return format_datetime(value, fmt)
8585

@@ -89,10 +89,10 @@ def format_date(value: str | datetime | None, fmt: str = "%Y-%m-%d") -> str:
8989

9090
return {
9191
"localtime": format_datetime,
92-
"localtime_short": lambda v: format_datetime(v, "%Y-%m-%d %H:%M %Z"),
92+
"localtime_short": lambda v: format_datetime(v, "%Y-%m-%d %H:%M"),
9393
"localdate": format_date,
9494
"localtimeonly": format_time,
95-
"localtimeonly_short": lambda v: format_time(v, "%H:%M %Z"),
95+
"localtimeonly_short": lambda v: format_time(v, "%H:%M"),
9696
}
9797

9898

src/meshcore_hub/web/templates/advertisements.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
{% block content %}
88
<div class="flex items-center justify-between mb-6">
99
<h1 class="text-3xl font-bold">Advertisements</h1>
10-
<span class="badge badge-lg">{{ total }} total</span>
10+
<div class="flex items-center gap-2">
11+
{% if timezone and timezone != 'UTC' %}<span class="text-sm opacity-60">{{ timezone }}</span>{% endif %}
12+
<span class="badge badge-lg">{{ total }} total</span>
13+
</div>
1114
</div>
1215

1316
{% if api_error %}

src/meshcore_hub/web/templates/map.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<div class="flex items-center justify-between mb-6">
77
<h1 class="text-3xl font-bold">Map</h1>
88
<div class="flex items-center gap-2">
9+
{% if timezone and timezone != 'UTC' %}<span class="text-sm opacity-60">{{ timezone }}</span>{% endif %}
910
<span id="node-count" class="badge badge-lg">Loading...</span>
1011
<span id="filtered-count" class="badge badge-lg badge-ghost hidden"></span>
1112
</div>

src/meshcore_hub/web/templates/messages.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
{% block content %}
88
<div class="flex items-center justify-between mb-6">
99
<h1 class="text-3xl font-bold">Messages</h1>
10-
<span class="badge badge-lg">{{ total }} total</span>
10+
<div class="flex items-center gap-2">
11+
{% if timezone and timezone != 'UTC' %}<span class="text-sm opacity-60">{{ timezone }}</span>{% endif %}
12+
<span class="badge badge-lg">{{ total }} total</span>
13+
</div>
1114
</div>
1215

1316
{% if api_error %}

src/meshcore_hub/web/templates/nodes.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
{% block content %}
88
<div class="flex items-center justify-between mb-6">
99
<h1 class="text-3xl font-bold">Nodes</h1>
10-
<span class="badge badge-lg">{{ total }} total</span>
10+
<div class="flex items-center gap-2">
11+
{% if timezone and timezone != 'UTC' %}<span class="text-sm opacity-60">{{ timezone }}</span>{% endif %}
12+
<span class="badge badge-lg">{{ total }} total</span>
13+
</div>
1114
</div>
1215

1316
{% if api_error %}

0 commit comments

Comments
 (0)