From f5c8d52686b7d1e24201aa030be4eddbcc950278 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Thu, 1 Oct 2026 04:18:45 +0200 Subject: [PATCH] fix(ui): keep a formatted time on one line The detail sheet wrapped "09:00 AM" and left "AM" on a line of its own. The time's spaces are now non-breaking, which also covers the footer's "last refreshed" time. Co-Authored-By: Claude Opus 5.5 --- src/shared/time.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/time.ts b/src/shared/time.ts index 16c6980..eb6c78d 100644 --- a/src/shared/time.ts +++ b/src/shared/time.ts @@ -283,7 +283,12 @@ export function formatAbsolute(iso: string | number, withTime: boolean): string year: "numeric", }); if (!withTime) return date; - return `${date}, ${d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" })}`; + // The time is one reading: a line break inside it strands "AM" on a line of + // its own, so its spaces are made non-breaking. + const time = d + .toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" }) + .replace(/\s/g, " "); + return `${date}, ${time}`; } export interface EventClock {