diff options
| author | Fuwn <[email protected]> | 2026-01-20 17:50:38 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-20 17:50:38 -0800 |
| commit | 454ac85022ffb014fc98b0f322c952d1494796a4 (patch) | |
| tree | 8b48aa6873f9dfcfa52999a5f9fc17ec9793b70b /internal/server/templates | |
| parent | feat: Add version tooltip to 'Powered by Kaze' footer (diff) | |
| download | kaze-454ac85022ffb014fc98b0f322c952d1494796a4.tar.xz kaze-454ac85022ffb014fc98b0f322c952d1494796a4.zip | |
fix: Respect display.timezone for version tooltip build date
- Include raw timestamp in tooltip data for browser timezone conversion
- Add timestampLabel field to identify which row contains the date
- JavaScript converts build date to browser timezone when timezone: Browser
- Falls back to configured timezone for server-side rendering
Diffstat (limited to 'internal/server/templates')
| -rw-r--r-- | internal/server/templates/index.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/server/templates/index.html b/internal/server/templates/index.html index 35f08c1..684819d 100644 --- a/internal/server/templates/index.html +++ b/internal/server/templates/index.html @@ -295,6 +295,19 @@ }); } } + // Convert version tooltip build date to browser timezone + if (data.timestamp && data.timestampLabel) { + const date = new Date(data.timestamp); + const formatted = date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }) + ' ' + + date.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false }); + if (data.rows) { + data.rows.forEach(function(row) { + if (row.label === data.timestampLabel) { + row.value = formatted; + } + }); + } + } {{end}} let html = '<span class="tooltip-header">' + data.header + '</span>'; |