Seven week starts, the same month
A calendar’s week origin is a layout rule. It decides which weekday sits in the first column; it does not change the civil dates.
February 2027 starts on Monday and has 28 days. With Monday first, its natural grid has four rows. Shift the origin to Tuesday and the 1st moves to the last column of that first row, so the grid needs five. Sunday first also needs five.
For weekStart w and weekday index d of the first date:
offset = (d - w + 7) mod 7
natural rows = ceil((offset + daysInMonth) / 7)
The visual rotates weekday labels with the origin. Keeping labels fixed while shifting dates silently mislabels weekdays. Weekend shading must rotate too. A stable six-row view is a separate design choice: it helps compare months, but it is not the natural month height.
When building a calendar, store civil dates as dates, derive the first weekday, and render columns relative to the selected origin. Then check month edges, leap years, responsive width and print cell height.
Blank-grid reference: https://www.betacalendars.com/blank-calendar
February 2027 example: https://www.betacalendars.com/february-calendar.html
Project: https://www.betacalendars.com/
Seven week starts, the same month
A calendar’s week origin is a layout rule. It decides which weekday sits in the first column; it does not change the civil dates.
February 2027 starts on Monday and has 28 days. With Monday first, its natural grid has four rows. Shift the origin to Tuesday and the 1st moves to the last column of that first row, so the grid needs five. Sunday first also needs five.
For weekStart w and weekday index d of the first date:
offset = (d - w + 7) mod 7
natural rows = ceil((offset + daysInMonth) / 7)
The visual rotates weekday labels with the origin. Keeping labels fixed while shifting dates silently mislabels weekdays. Weekend shading must rotate too. A stable six-row view is a separate design choice: it helps compare months, but it is not the natural month height.
When building a calendar, store civil dates as dates, derive the first weekday, and render columns relative to the selected origin. Then check month edges, leap years, responsive width and print cell height.
Blank-grid reference: https://www.betacalendars.com/blank-calendar
February 2027 example: https://www.betacalendars.com/february-calendar.html
Project: https://www.betacalendars.com/