Repository navigation
fix(zaplytics): UTC calendar ops across range bounds and heatmap grid - #162
Conversation
Ports fork-verified fixes: - utils: enforce calendar/exact contract in both range bounds, exact since for rolling ranges, UTC bucketing, skip unfetched events in kind grouping, include end day in custom ranges - heatmap: UTC month/year labels + tooltip; week grid iterates with UTC setUTCDate/getUTCDay — local-time setDate duplicated a cell and dropped the final day across DST transitions (verified spring/fall in LA/NY/Berlin)
Architecture Data flow Review 1 finding · reviewed
|
formatPeriodLabel/formatDayLabel parsed UTC keys but formatted in local time — western timezones displayed the previous day. Hour buckets stay local (they're instants, not calendar keys); month keys were already consistent.
Summary
Ports two fork-verified zaplytics fixes:
utils.ts: enforces the calendar/exact contract in both range bounds, uses exactsincefor rolling ranges, consistent UTC bucketing, skips unfetched events in kind grouping, includes the end day in custom rangesCommunityHeatmap.tsx: UTC month/year labels + tooltip, and the week grid now iterates withsetUTCDate/getUTCDay— local-timesetDateduplicated a cell and dropped the final day across DST transitionsUpstream's copies of both files were byte-identical to our pre-fix state, so this is a verbatim port.
Test plan
tsc --noEmitclean (only pre-existingsanitizeSchema.ts/hast-util-sanitizeerror, unrelated)Generated with Devin