(ts: number)
| 27 | } |
| 28 | |
| 29 | export function humanizeTs(ts: number): string { |
| 30 | const timestampMs = ts * 1000; |
| 31 | const diff = Math.abs(Date.now() - timestampMs); |
| 32 | if (diff > RELATIVE_THRESHOLD_MS) { |
| 33 | return formatAbsoluteDate(timestampMs); |
| 34 | } |
| 35 | return formatRelativeTime(timestampMs); |
| 36 | } |
| 37 | |
| 38 | export const humanizeDurationV1 = (duration: Duration | undefined) => { |
| 39 | if (!duration) return "-"; |
no test coverage detected