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

Fix math in calendar #2714

Merged
merged 9 commits into from
Oct 3, 2022
Merged

Conversation

Manishearth
Copy link
Member

Fixes #2254

Progress on #2703 (but doesn't add many more tests)

I didn't touch week_of since it's not one of the Reingold functions. Someone should figure out what the correct math is to be used there.

I added a quotient() function for readability since we divide a LOT more often than taking modulus. I'm importing it directly since it's a local helper function; helpers::quotient() is also common Rust style but it's more common when it's from a different crate; and also it's used enough that the verbosity makes it harder to read.

@Manishearth Manishearth requested a review from a team as a code owner October 3, 2022 18:51
@Manishearth Manishearth requested a review from sffc October 3, 2022 18:51
sffc
sffc previously approved these changes Oct 3, 2022
components/calendar/src/iso.rs Show resolved Hide resolved
components/calendar/src/iso.rs Show resolved Hide resolved
@Manishearth Manishearth requested a review from sffc October 3, 2022 20:42
@Manishearth Manishearth merged commit c33971f into unicode-org:main Oct 3, 2022
@Manishearth Manishearth deleted the fix-negative branch October 3, 2022 21:32
@robertbastian robertbastian mentioned this pull request Jan 23, 2023
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.

Coptic and Ethiopic date conversions from iso fail for dates sufficiently in the past
2 participants