From b341146fce40ee8bdaf771c4c5269160198b6386 Mon Sep 17 00:00:00 2001 From: garethgeorge Date: Wed, 8 May 2024 01:13:51 -0700 Subject: [PATCH] fix: date formatting --- webui/src/lib/formatting.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webui/src/lib/formatting.ts b/webui/src/lib/formatting.ts index 08cb0879..135a6ab3 100644 --- a/webui/src/lib/formatting.ts +++ b/webui/src/lib/formatting.ts @@ -18,6 +18,9 @@ export const formatBytes = (bytes?: number | string) => { const fmtHourMinute = new Intl.DateTimeFormat(undefined, { hour: "2-digit", minute: "2-digit", + day: "2-digit", + month: "2-digit", + year: "numeric", }); const timezoneOffsetMs = new Date().getTimezoneOffset() * 60 * 1000; @@ -28,9 +31,8 @@ export const formatTime = (time: number | string | Date) => { } else if (time instanceof Date) { time = time.getTime(); } - const d = new Date(); - d.setTime(time - timezoneOffsetMs); - return d.toISOString().substring(0, 10) + " at " + fmtHourMinute.format(d); + const d = new Date(time); + return fmtHourMinute.format(d); }; export const localISOTime = (time: number | string | Date) => {