* Parse a Drizzle `mode: 'string'` timestamp into a Date. * Hermes can't parse PostgreSQL's default format (`2026-03-13 14:30:00+00`), * so we normalise the space separator to `T` before parsing.
(value: string)
| 11 | } |
| 12 | |
| 13 | // Ordered largest-first so the first unit whose bucket fits wins; the values |
| 14 | // mirror the original minute/hour/day/month/year buckets. |
| 15 | const RELATIVE_TIME_UNITS: readonly { unit: Intl.RelativeTimeFormatUnit; seconds: number }[] = [ |
| 16 | { unit: 'year', seconds: 365 * 24 * 60 * 60 }, |
| 17 | { unit: 'month', seconds: 30 * 24 * 60 * 60 }, |
| 18 | { unit: 'day', seconds: 24 * 60 * 60 }, |
| 19 | { unit: 'hour', seconds: 60 * 60 }, |
| 20 | { unit: 'minute', seconds: 60 }, |
| 21 | ]; |
| 22 | |
| 23 | /** |
| 24 | * Returns a human-readable relative time string like "3 days ago" or "in 2 |
no test coverage detected