Skip to content

Add IsoDate::try_balance method #262

Closed
nekevss wants to merge 1 commit into
mainfrom
fix-max-duration-bug
Closed

Add IsoDate::try_balance method #262
nekevss wants to merge 1 commit into
mainfrom
fix-max-duration-bug

Conversation

@nekevss

@nekevss nekevss commented Apr 18, 2025

Copy link
Copy Markdown
Member

This PR closes #250. By fixing the current panicking behavior of the test case.

For background, the current specification lists BalanceISODate as fault tolerant. With the neri-schneider calculations, we ultimately don't support calculating a date with epoch days of 2^53 - 1. So instead of waiting for 12.2.6 CalendarDateAdd Step 3 to throw invalid epoch days (1,000,000,001 epoch days), this adds a new try_balance method to throw invalid epoch days early when calculating the epoch days.

To note, I have a feeling that there is most likely more changes to be made along this general line related to day being represented by an i32 vs i64, but I believe those would be linked to changes related to #189.

@nekevss nekevss added C-bug Something isn't working C-internal Internal library improvements labels Apr 18, 2025
@nekevss nekevss added this to the 0.1 Blocking milestone Apr 18, 2025
@nekevss

nekevss commented Apr 26, 2025

Copy link
Copy Markdown
Member Author

Closing this in favor of #268 as it addresses this concern and then some.

@nekevss nekevss closed this Apr 26, 2025
@nekevss nekevss deleted the fix-max-duration-bug branch June 6, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Something isn't working C-internal Internal library improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in IsoDate::add_date_duration on max range calculations

1 participant