MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isValidDay

Function isValidDay

telemetry-dashboard/src/api.ts:70–74  ·  view source on GitHub ↗

Rejects the wrong shape and impossible dates alike (`2026-02-31` round-trips as March).

(day: string)

Source from the content-addressed store, hash-verified

68
69/** Rejects the wrong shape and impossible dates alike (`2026-02-31` round-trips as March). */
70function isValidDay(day: string): boolean {
71 if (!DAY_RE.test(day)) return false;
72 const t = Date.parse(`${day}T00:00:00Z`);
73 return Number.isFinite(t) && utcDay(t) === day;
74}
75
76const dayMs = (day: string): number => Date.parse(`${day}T00:00:00Z`);
77const addDays = (day: string, delta: number): string => utcDay(dayMs(day) + delta * DAY_MS);

Callers 1

parseRangeFunction · 0.70

Calls 1

utcDayFunction · 0.70

Tested by

no test coverage detected