(anchor: Date, firstDay: number)
| 75 | } |
| 76 | |
| 77 | function buildMonthGrid(anchor: Date, firstDay: number): Date[] { |
| 78 | const first = firstOfMonth(anchor) |
| 79 | // Walk back to the most recent `firstDay` weekday (may be in the prev month). |
| 80 | const offset = (first.getDay() - firstDay + 7) % 7 |
| 81 | const start = addDays(first, -offset) |
| 82 | return Array.from({ length: 42 }, (_, i) => addDays(start, i)) |
| 83 | } |
| 84 | |
| 85 | function formatMonthLabel(d: Date): string { |
| 86 | return d.toLocaleDateString(undefined, { month: 'long', year: 'numeric' }) |
no test coverage detected