Skip to content

Fix Gregorian leap-year handling#28

Open
OsirisSlain wants to merge 1 commit into
bo0ts:masterfrom
OsirisSlain:fix-leap-year-handling
Open

Fix Gregorian leap-year handling#28
OsirisSlain wants to merge 1 commit into
bo0ts:masterfrom
OsirisSlain:fix-leap-year-handling

Conversation

@OsirisSlain

Copy link
Copy Markdown
Contributor

Fix leap-year calculations to use the Gregorian year derived from YOLD.

YOLD is Gregorian + 1166, so converting back for leap-year checks needs to subtract 1166. The old helper added 1166, which made X-Day countdown calculations drift around some leap-year boundaries.

This also makes explicit Feb 29 validation use the same no-year-zero-adjusted year that ddate stores internally, fixing BCE leap-day handling.

Examples affected:

  • 29 2 -1 is now accepted as St. Tib's Day
  • 29 2 -4 is now rejected
  • century leap rules are applied through the shared leapp() helper

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