()
| 1 | let timestampFormatter: Intl.DateTimeFormat | null = null |
| 2 | export function initTimestampFormatter() { |
| 3 | if (timestampFormatter) return |
| 4 | try { |
| 5 | timestampFormatter = new Intl.DateTimeFormat(undefined, { |
| 6 | hour: '2-digit', |
| 7 | minute: '2-digit', |
| 8 | }) |
| 9 | } catch { |
| 10 | timestampFormatter = null |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | export function formatTimestamp(date = new Date()): string { |
| 15 | if (timestampFormatter) { |