From 3945c6068197b8a1ba094c5d75f9aa4f2071fbc0 Mon Sep 17 00:00:00 2001 From: Bobban Rydh Date: Fri, 16 Oct 2026 21:02:41 +0200 Subject: [PATCH] Make the wall display and Proxmox dates follow the date and time settings The wall clock, date line and 'Updated' footer used the browser locale, and the Proxmox backup tasks and PBS page used toLocaleString. They now use the display settings via new formatDate/formatTime helpers. Co-Authored-By: Claude Sonnet 5.5 --- web/src/pages/PbsBackup.tsx | 3 ++- web/src/pages/Proxmox.tsx | 3 ++- web/src/pages/Wall.tsx | 7 ++++--- web/src/utils/date.ts | 31 +++++++++++++++---------------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/web/src/pages/PbsBackup.tsx b/web/src/pages/PbsBackup.tsx index 1214a8b..2f8f58f 100644 --- a/web/src/pages/PbsBackup.tsx +++ b/web/src/pages/PbsBackup.tsx @@ -10,6 +10,7 @@ import { } from "../api/client"; import { useSortable } from "../hooks/useSortable"; import SortableTh from "../components/SortableTh"; +import { formatDateTime } from "../utils/date"; import { downloadCsv } from "../utils/csv"; import IntegrationPageTitle from "../components/IntegrationPageTitle"; import { ErrorNotice } from "../components/Notice"; @@ -28,7 +29,7 @@ function formatBytes(bytes: number | null): string { function formatDate(unixSeconds: number | null): string { if (unixSeconds === null) return "—"; - return new Date(unixSeconds * 1000).toLocaleString(); + return formatDateTime(new Date(unixSeconds * 1000)); } function formatUptime(seconds: number | null): string { diff --git a/web/src/pages/Proxmox.tsx b/web/src/pages/Proxmox.tsx index 47c0d6e..7869be1 100644 --- a/web/src/pages/Proxmox.tsx +++ b/web/src/pages/Proxmox.tsx @@ -23,6 +23,7 @@ import { SearchBox } from "../components/TableToolbar"; import { useTableSearch } from "../hooks/useTableSearch"; import DetailDrawer, { ObjectDetails } from "../components/DetailDrawer"; import { useRowDetail } from "../hooks/useRowDetail"; +import { formatDateTime } from "../utils/date"; function proxmoxStatusBadge(status: string) { return status === "running" ? ( @@ -460,7 +461,7 @@ export default function Proxmox({ user }: { user: CurrentUser }) { {t.node} {t.guestId ?? "—"} {backupStatusBadge(t)} - {new Date(t.startTime).toLocaleString()} + {formatDateTime(new Date(t.startTime))} {formatDuration(t.startTime, t.endTime)} ))} diff --git a/web/src/pages/Wall.tsx b/web/src/pages/Wall.tsx index 2f5bee1..df3bc08 100644 --- a/web/src/pages/Wall.tsx +++ b/web/src/pages/Wall.tsx @@ -4,6 +4,7 @@ import { api, type IntegrationSummary, type MaintenanceWindow, type ServerSummar import { alertBadge, useAlertsReport } from "../hooks/useAlertsReport"; import { useEnvironment } from "../utils/environment"; import { formatRemaining } from "../utils/duration"; +import { formatDate, formatTime } from "../utils/date"; const REFRESH_MS = 30_000; @@ -133,8 +134,8 @@ export default function Wall() { Homelab Manager {environment?.name && {environment.name}}
-
{now.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}
-
{now.toLocaleDateString([], { weekday: "long", day: "numeric", month: "long" })}
+
{formatTime(now, false)}
+
{now.toLocaleDateString([], { weekday: "long" })} {formatDate(now)}
@@ -223,7 +224,7 @@ export default function Wall() {