Skip to content

Calendar: optional ISO week numbers on the month grid - #154

Open
mvanhorn wants to merge 1 commit into
HeyPuter:mainfrom
mvanhorn:feat/calendar-week-numbers
Open

mvanhorn wants to merge 1 commit into
HeyPuter:mainfrom
mvanhorn:feat/calendar-week-numbers

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 30, 2026 •

Copy link
Copy Markdown

Calendar: optional ISO week numbers on the month grid

The month view and the sidebar mini-calendar can show the ISO week number of each row. The setting is off by default, so the 7-column layout is unchanged until it is turned on.

What changes

  • Show week numbers sits with the other layout toggles in the account menu. When it is on, a gutter of week numbers appears to the left of the month grid and of the sidebar mini-calendar.
  • Each number is the ISO week of the Thursday in that 7-day row, so it stays the same whether the week starts on Sunday or Monday. Clicking a number opens that week. The week-view title gains · Week N beside the date range.
  • The year view is left as it is: those mini-months are too tight for another column.
  • The setting is stored with the rest of the user's preferences. A value that is not the boolean true is treated as off.

Tests

  • isoWeekNumber / displayedWeekNumber cover week 1 spanning December, a 53-week year, a mid-year Thursday, Sunday-start vs Monday-start rows, and that the helpers do not mutate their input.
  • Month and mini-calendar render tests cover the default 7-column layout, the numbers for July 2026, a Monday-start row, and a click opening that week.
  • App tests cover the account-menu toggle, the week-view title with the setting on and off, and that clicking a month-grid number switches to week view without writing defaultView.
  • Store load sanitizes a non-boolean showWeekNumbers back to false.
  • npm test: 1769 passed, 3 skipped. npm run build succeeds.

Test plan

  • cd src/calendar && npm ci && npm test && npm run build
  • Month view, account menu, turn on Show week numbers; confirm a number appears on each row and the weekday headers still line up
  • Click a week number and land on that week, with Week N in the title
  • Turn on Start week on Monday and confirm the number on a given row is still the ISO week of that row's Thursday
  • Reload and confirm the setting is still on; turn it off and confirm the gutter is gone

Not included

  • Week numbers are not drawn on the year view.
  • There is no separate numbering scheme besides ISO weeks.

Demo

demo

A setting in the account menu shows ISO week numbers along the month view
and the sidebar mini-calendar. Click a number to open that week. The week
title includes the number. Off by default.
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