mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02:00
# Description of Changes Adds the code for the SaaS frontend as proprietary code to the OSS repo. This version of the code is adapted from 22/1/2026, which was the last SaaS version based on the 'V2' design. This will move us closer to being able to have the OSS products understand whether the user has a SaaS account, and provide the correct UI in those cases.
15 lines
438 B
TypeScript
15 lines
438 B
TypeScript
export function formatUTC(iso: string, withTime: boolean): string {
|
|
const date = new Date(iso);
|
|
if (Number.isNaN(date.getTime())) return "-";
|
|
const formatted = new Intl.DateTimeFormat("en-US", {
|
|
month: "short",
|
|
day: "numeric",
|
|
year: "numeric",
|
|
...(withTime ? { hour: "2-digit", minute: "2-digit", hour12: false } : {}),
|
|
timeZone: "UTC",
|
|
}).format(date);
|
|
return withTime ? `${formatted} UTC` : formatted;
|
|
}
|
|
|
|
|