(timestampMs: number)
| 52 | } |
| 53 | |
| 54 | export function formatAbsoluteDate(timestampMs: number): string { |
| 55 | const date = new Date(timestampMs); |
| 56 | const now = new Date(); |
| 57 | |
| 58 | if (date.getFullYear() === now.getFullYear()) { |
| 59 | return new Intl.DateTimeFormat(getActiveLocale(), { |
| 60 | month: "short", |
| 61 | day: "numeric", |
| 62 | }).format(date); |
| 63 | } |
| 64 | |
| 65 | return new Intl.DateTimeFormat(getActiveLocale(), { |
| 66 | month: "short", |
| 67 | day: "numeric", |
| 68 | year: "numeric", |
| 69 | }).format(date); |
| 70 | } |
no test coverage detected