Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow surplus days when adding months to a date #100

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

jfinkels
Copy link
Contributor

Change the behavior of parse_relative_time_at_date() so that adding months to a given date causes surplus days to overflow to the next month. For example, adding 1 month to 1996-03-31 would be 1996-04-31, but April only has 30 days, so the surplus day rolls over to the next month, resulting in 1996-05-01.

Closes #98

Change the behavior of `parse_relative_time_at_date()` so that adding
months to a given date causes surplus days to overflow to the next
month. For example, adding 1 month to 1996-03-31 would be 1996-04-31,
but April only has 30 days, so the surplus day rolls over to the next
month, resulting in 1996-05-01.

Closes uutils#98
@sylvestre sylvestre force-pushed the add-months-overflow-surplus-days branch from 2fcc2c0 to 90d22a2 Compare January 18, 2025 22:23
@sylvestre sylvestre merged commit 938aa96 into uutils:main Jan 18, 2025
14 checks passed
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (240abf7) to head (90d22a2).
Report is 6 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #100   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jfinkels jfinkels deleted the add-months-overflow-surplus-days branch January 20, 2025 13:19
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.

parse_relative_time_at_date() fails to account for leap day when adding one year
2 participants