Skip to content

Fix date_range limit to account for leap days#28

Merged
chetmancini merged 1 commit intomasterfrom
chetmancini/code-review-pass
Feb 6, 2026
Merged

Fix date_range limit to account for leap days#28
chetmancini merged 1 commit intomasterfrom
chetmancini/code-review-pass

Conversation

@chetmancini
Copy link
Copy Markdown
Owner

Summary

Fixes the 10-year limit in date_range() to correctly account for leap days. The previous limit of 3650 days (10 * 365) incorrectly rejected valid 10-calendar-year ranges containing leap days.

Changes

  • Updated the limit from 10 * DAYS_IN_YEAR to 10 * DAYS_IN_YEAR + 3 (3653 days)
  • This allows up to 3 leap days that can naturally occur within any 10-year span
  • Example: 2020-01-01 to 2029-12-31 (3653 days with 3 leap years) now works correctly

Testing

All 126 tests pass, including verification that the reported example case is now accepted.

🤖 Generated with Claude Code

The 10-year limit used 3650 days (10 * 365), but a valid 10-calendar-year range
with leap days can span up to 3653 days. For example, 2020-01-01 to 2029-12-31
contains 3 leap years (2020, 2024, 2028) and should be accepted but was rejected.

Changed the threshold from 10 * DAYS_IN_YEAR to 10 * DAYS_IN_YEAR + 3 to
accommodate up to 3 leap days that can occur in any 10-year span.

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
@chetmancini chetmancini merged commit 2fc4ae1 into master Feb 6, 2026
6 checks passed
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