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

Function isValidDay

telemetry-dashboard/src/api.ts:74–78  ·  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

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

Callers 1

parseRangeFunction · 0.70

Calls 2

parseMethod · 0.80
utcDayFunction · 0.70

Tested by

no test coverage detected