Improve edge case handling, tests, and documentation #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the dateutils library by addressing edge cases, adding comprehensive tests, and enhancing documentation based on a thorough code review.
Critical Fixes
foldattribute behavior toconvert_timezone()anddatetime_to_utc()parse_date()returnsNonefor invalid dates like Feb 29 in non-leap yearsNew Edge Case Tests
test_parse_iso8601_nanosecond_truncationtest_datetime_to_utc_dst_ambiguous_timesfoldbehaviortest_parse_date_invalid_calendar_datestest_add_business_days_negative_cross_year_with_holidaystest_get_week_number_jan1_in_previous_year_weektest_format_timezone_offset_dst_varianceUTC+5:45testDocumentation Enhancements
workdays_between()andadd_business_days()docstringsget_us_federal_holidays()pretty_date()approximations: Clarified that months=30 days, years=365 daysformat_timezone_offset()DST note: Documents that returned offset varies for DST zonesTest plan
make lint)make format-check)make typecheck)🤖 Generated with Claude Code