-
Notifications
You must be signed in to change notification settings - Fork 225
Add CLDR calendar codes to ICU4X calendar docs #7082
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -683,40 +683,76 @@ impl<C: AsCalendar<Calendar = AnyCalendar>> Date<C> { | |
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] | ||
pub enum AnyCalendarKind { | ||
/// The kind of a [`Buddhist`] calendar | ||
/// | ||
/// This corresponds to the `"buddhist"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Buddhist, | ||
/// The kind of a [`Chinese`] calendar | ||
/// | ||
/// This corresponds to the `"chinese"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Chinese, | ||
/// The kind of a [`Coptic`] calendar | ||
/// | ||
/// This corresponds to the `"coptic"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Coptic, | ||
/// The kind of a [`Dangi`] calendar | ||
/// | ||
/// This corresponds to the `"dangi"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Dangi, | ||
/// The kind of an [`Ethiopian`] calendar, with Amete Mihret era | ||
/// | ||
/// This corresponds to the `"ethiopic"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Ethiopian, | ||
/// The kind of an [`Ethiopian`] calendar, with Amete Alem era | ||
/// | ||
/// This corresponds to the `"ethioaa"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
EthiopianAmeteAlem, | ||
/// The kind of a [`Gregorian`] calendar | ||
/// | ||
/// This corresponds to the `"gregory"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Gregorian, | ||
/// The kind of a [`Hebrew`] calendar | ||
/// | ||
/// This corresponds to the `"hebrew"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Hebrew, | ||
/// The kind of a [`Indian`] calendar | ||
/// | ||
/// This corresponds to the `"indian"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Indian, | ||
/// The kind of an [`HijriTabular`] calendar using [`HijriTabularLeapYears::TypeII`] and [`HijriTabularEpoch::Friday`] | ||
/// | ||
/// This corresponds to the `"islamic-civil"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
HijriTabularTypeIIFriday, | ||
/// The kind of an [`HijriSimulated`], Mecca calendar | ||
/// | ||
/// This corresponds to the `"islamic-rgsa"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
HijriSimulatedMecca, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Observation: we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's not used by Temporal but it's there. Probably wouldn't have it if we didn't. I recently tweaked temporal_rs so that it will discard rgsa inputs. |
||
/// The kind of an [`HijriTabular`] calendar using [`HijriTabularLeapYears::TypeII`] and [`HijriTabularEpoch::Thursday`] | ||
/// | ||
/// This corresponds to the `"islamic-tbla"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
HijriTabularTypeIIThursday, | ||
/// The kind of an [`HijriUmmAlQura`] calendar | ||
/// | ||
/// This corresponds to the `"islamic-umalqura"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
HijriUmmAlQura, | ||
/// The kind of an [`Iso`] calendar | ||
/// | ||
/// This corresponds to the `"iso8601"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Iso, | ||
/// The kind of a [`Japanese`] calendar | ||
/// | ||
/// This corresponds to the `"japanese"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Japanese, | ||
/// The kind of a [`JapaneseExtended`] calendar | ||
/// | ||
/// This corresponds to the `"japanext"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
JapaneseExtended, | ||
/// The kind of a [`Persian`] calendar | ||
/// | ||
/// This corresponds to the `"persian"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Persian, | ||
/// The kind of a [`Roc`] calendar | ||
/// | ||
/// This corresponds to the `"roc"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
Roc, | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ use tinystr::tinystr; | |
/// This calendar is identical to the [`Gregorian`](super::Gregorian) calendar, | ||
/// except that it uses a single `default` era instead of `bce` and `ce`. | ||
/// | ||
/// This corresponds to the `"iso8601"` [CLDR calendar](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: I'm not sure about this. while we currently resolve the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was unsure of that part. Can remove this snippet. Temporal considers this to mean a generally useful ISO calendar. |
||
/// | ||
/// # Era codes | ||
/// | ||
/// This calendar uses a single era: `default` | ||
|
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.
these should link to the
CalendarAlgorithm
variant, which already links to the LDMLThere 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.
https://unicode-org.github.io/icu4x/rustdoc/icu/calendar/preferences/enum.CalendarAlgorithm.html
Yeah but the exact correspondence isn't documented there either.
Happy to add docs there too but I don't actually think we should cross reference here: I've been annoyed at the number of clicks it takes to figure this out each time and it's fine to be repetitive in docs.