Format UTC offset as 'UTC +HH:MM' with non-breaking space (Angular parity)
Angular's captioned-time-group renders 'UTC {{ utc }}', producing
'UTC +03:00' on screen. React was emitting 'UTC+03:00' without the
separator, making the time details read slightly differently. Insert a
U+00A0 non-breaking space between 'UTC' and the signed offset so the
time-table values ('15:30 UTC +03:00 18.04.2026') line up with Angular.
This commit is contained in:
@@ -95,9 +95,11 @@ export function formatUtcOffset(iso: string): string {
|
||||
const m = ISO_OFFSET_RE.exec(iso);
|
||||
const off = m?.[6];
|
||||
if (!off) return "";
|
||||
if (off === "Z") return "UTC+00:00";
|
||||
// Angular's captioned-time-group renders 'UTC {{ utc }}' — keep the
|
||||
// non-breaking space so '15:30 UTC +03:00' reads the same across pages.
|
||||
if (off === "Z") return "UTC\u00A0+00:00";
|
||||
const normalized = off.includes(":") ? off : `${off.slice(0, 3)}:${off.slice(3)}`;
|
||||
return `UTC${normalized}`;
|
||||
return `UTC\u00A0${normalized}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user