Files
Your NameandClaude Opus 5 7bc3b80b70 fix(holidays): Canada and UK substitute forward, not back onto Christmas
Boxing Day was landing on 25 Dec 2026, on top of Christmas Day. The shared
observed() helper applied the US federal Sat->Fri rule to every country, so
Sat 26 Dec moved backwards. Canada and the UK substitute forwards to the next
free weekday instead.

Two neighbouring bugs came out of the same helper:

- Hand-built date strings underflowed. A holiday on the 1st shifting back
  produced '2022-01-00', an impossible date, for US/CA/UK New Year's Day in
  2022 and 2028 and Canada Day in 2023 and 2028. Date math now goes through a
  real Date so month and year boundaries carry.
- Nothing stopped two holidays claiming one date. Christmas and Boxing Day
  collided in 2022 and 2026 for both CA and UK. Substitution now steps over
  dates already taken, matching the published pairings (gov.uk 2022: Boxing
  Day Mon 26 Dec, Christmas Day substitute Tue 27 Dec).

US federal keeps its own backwards rule, and now crosses the year boundary
correctly: 1 Jan 2022 observed Fri 31 Dec 2021, per OPM.

Correcting a date orphans the event already on disk, since the event ID embeds
the observed date and the toggle-off path looked events up by exact ID. Both
toggles now sweep by title slug and year instead, so turning a calendar off,
or back on, clears what an older build left at the wrong date.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jmow72MHKMVCQCvybwhMJm
2026-07-31 15:04:39 -05:00
..