Skip to content

fix(site): label weekly chart buckets by date, not ISO week number - #205

Merged
Oscar-west merged 1 commit into
mainfrom
fix/weekly-date-labels
Sep 11, 2026
Merged

Oscar-west merged 1 commit into
mainfrom
fix/weekly-date-labels

Conversation

@Oscar-west

Copy link
Copy Markdown
Contributor

Why

Follow-up to #204. The weekly-resolution charts label their x-axis with ISO week numbers (u16 … u37) and tooltips with Uke 17 · 2026. Weekly buckets are keyed YYYY-Www, so the formatters emitted week numbers — but readers want date/month, not week numbers.

What

  • bucket-format.ts: weekly buckets now labelled by the week's Monday date.
    • Axis (formatBucketShort): 20. apr — same style as daily ticks.
    • Tooltip (formatBucket): 28. apr – 04. mai 2026 range (clearly a week, still date-based).
  • New isoWeekMondayUTC (inverse of isoWeekKey in range.ts), with roundtrip + boundary tests.
  • Daily and monthly labels unchanged. Shared formatter, so this fixes the 6m/weekly view on all pillars, not just /arbeidsmarked.

Verified

pnpm typecheck ✓ · bucket-format.test.ts 5/5 ✓ (incl. 2026-W17 → 2026-04-20, ISO-week roundtrips across year boundaries). Will confirm on the live chart after deploy.

🤖 Generated with Claude Code

Weekly buckets are keyed YYYY-Www, and the shared axis/tooltip formatters
rendered that as "u17" / "Uke 17 · 2026". Readers want plain dates. Convert
weekly labels to the week's Monday date: axis "20. apr" (same style as the
daily ticks), tooltip a "28. apr - 04. mai 2026" range. Daily and monthly
labels are unchanged. Adds isoWeekMondayUTC (inverse of range.ts isoWeekKey)
with roundtrip tests. Affects every chart's 6m/weekly view, all pillars.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Oscar-west
Oscar-west merged commit 5b3dc95 into main Sep 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant