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

Function isValidDay

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

80
81/** Rejects the wrong shape and impossible dates alike (`2026-02-31` round-trips as March). */
82function isValidDay(day: string): boolean {
83 if (!DAY_RE.test(day)) return false;
84 const t = Date.parse(`${day}T00:00:00Z`);
85 return Number.isFinite(t) && utcDay(t) === day;
86}
87
88const dayMs = (day: string): number => Date.parse(`${day}T00:00:00Z`);
89const 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