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

Implementation of Ord for Date assumes equal Calendars #87

Open
AngusGMorrison opened this issue Mar 30, 2024 · 0 comments
Open

Implementation of Ord for Date assumes equal Calendars #87

AngusGMorrison opened this issue Mar 30, 2024 · 0 comments

Comments

@AngusGMorrison
Copy link
Contributor

The implementation of Ord for Date assumes that the Calendars of the inputs date are the same.

This isn't a terrible assumption, since the Date constructor doesn't currently allow the creation of overlapping dates in different calendars, and Dates are immutable. Still, we shouldn't lose sight of this as the API evolves.

To do this properly, in the situation where we're comparing a Gregorian date with a date in either of the Julian calendars, we'd need a function to check whether the Julian calendar date is 14 days or less ahead of a Gregorian date, and adjust the return value of Ord accordingly.

@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@helgee helgee reopened this Nov 19, 2024
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

No branches or pull requests

2 participants