-
Notifications
You must be signed in to change notification settings - Fork 244
Add full support for r datetime symbol
#7327
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
base: main
Are you sure you want to change the base?
Conversation
c0cea90 to
e6b97e4
Compare
| /// | ||
| /// Lunar calendars, like [`Hijri`](crate::cal::Hijri), drift quickly through the Gregorian year, so related Gregorian | ||
| /// years are frequently repeated. | ||
| pub fn related_gregorian(self) -> i32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that it's allowed to be negative (no eras), this should be ISO year, yes? or gregorian extended year.
I agree that hte "ISO calendar" isn't the most consistent concept, but "ISO year" is much more well defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLDR calls it "related Gregorian" year
ISO is a format, Gregorian is a calendar. I will die on this hill
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If that's what CLDR calls it fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gregorian does not have signed years.
It has extended years; you could call it related_extended_gregorian but I don't think anyone wants that.
Plus, we already call it related_iso for cyclic years. You're the king of consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to deprecate any mentions of related_iso
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISO is a format
ISO-8601 defines a calendar system, not just a format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it defines a string format for the proleptic Gregorian calendar
sffc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in CLDR, but it seems to have footguns. We shouldn't add new things that have known footguns.
| } | ||
| } | ||
|
|
||
| /// The Gregorian year in which this year started. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Observation: This produces surprising results for calendars with new years in the second half of the year, like Hebrew, Ethiopian, Coptic. It also means that multiple Hijri years will have the same related ISO year.
sffc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been consistent about Gregorian meaning the calendar with eras and nonzero year numbers. Let's not muck it up
what's the footgun?
|
That there isn't a 1-to-1 mapping.
I prefer Temporal uses ISO for this. It's literally encoded into the API: |
The |
I consider ECMA's and Temporal's distinction between ISO and Gregorian a major flaw. I'd also like to point out that |
|
There were lengthy discussions in Temporal where we arrived at these designs, weighing lots and lots of tradeoffs. I could write it up but I have better things to spend my time on today. |
|
I don't really care about the name here. Self-consistency is a good motivator. I'd like to avoid deprecating things further just for naming reasons. |
Currently we only support the
rsymbol for cyclic calendars, however nothing in the LDML says that it is only usable with cyclic calendars. This adds support for all other calendars.