Files
ITWorx_MCP_Hub-Public/apps/web/src/format.ts
T

9 lines
558 B
TypeScript

export const BRUSSELS_TIME_ZONE = "Europe/Brussels";
export function formatBrusselsTime(value: string | null): string {
if (!value) return "Never recorded";
const date = new Date(value);
if (Number.isNaN(date.getTime())) return "Unknown time";
return new Intl.DateTimeFormat("en-GB", { timeZone: BRUSSELS_TIME_ZONE, dateStyle: "medium", timeStyle: "short" }).format(date);
}
export function healthLabel(value: string): string { return value.replace(/(^|-)([a-z])/g, (_, separator: string, letter: string) => `${separator}${letter.toUpperCase()}`); }