(atMs: number)
| 38 | |
| 39 | /** UTC YYYY-MM-DD — the key every event, rollup and chart is bucketed on. */ |
| 40 | export function utcDay(atMs: number): string { |
| 41 | return new Date(atMs).toISOString().slice(0, 10); |
| 42 | } |
| 43 | |
| 44 | /** Rejects both the wrong shape and impossible dates (`2026-02-31` round-trips as `2026-03-03`). */ |
| 45 | export function isValidDay(day: string): boolean { |
no outgoing calls
no test coverage detected