icu_locale_core/preferences/extensions/unicode/keywords/calendar.rs
1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5#![allow(non_snake_case)]
6
7use crate::preferences::extensions::unicode::enum_keyword;
8
9enum_keyword!(
10 /// Hijri Calendar sub-type
11 ///
12 /// The list is based on [`CLDR Calendars`](https://github.com/unicode-org/cldr/blob/main/common/bcp47/calendar.xml)
13 HijriCalendarAlgorithm {
14 /// Hijri calendar, Umm al-Qura
15 Umalqura,
16 /// Hijri calendar, tabular (intercalary years \[2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch)
17 Tbla,
18 /// Hijri calendar, tabular (intercalary years \[2,5,7,10,13,16,18,21,24,26,29] - civil epoch)
19 Civil,
20 /// Hijri calendar, Saudi Arabia sighting
21 Rgsa
22});
23
24enum_keyword!(
25 /// A Unicode Calendar Identifier defines a type of calendar.
26 ///
27 /// This selects calendar-specific data within a locale used for formatting and parsing,
28 /// such as date/time symbols and patterns; it also selects supplemental calendarData used
29 /// for calendrical calculations. The value can affect the computation of the first day of the week.
30 ///
31 /// The valid values are listed in [LDML](https://unicode.org/reports/tr35/#UnicodeCalendarIdentifier).
32 CalendarAlgorithm {
33 /// Thai Buddhist calendar (same as Gregorian except for the year)
34 ("buddhist" => Buddhist),
35 /// Traditional Chinese calendar
36 ("chinese" => Chinese),
37 /// Coptic calendar
38 ("coptic" => Coptic),
39 /// Traditional Korean calendar
40 ("dangi" => Dangi),
41 /// Ethiopic calendar, Amete Alem (epoch approx. 5493 B.C.E)
42 ("ethioaa" => Ethioaa),
43 /// Ethiopic calendar, Amete Mihret (epoch approx, 8 C.E.)
44 ("ethiopic" => Ethiopic),
45 /// Gregorian calendar
46 ("gregory" => Gregory),
47 /// Traditional Hebrew calendar
48 ("hebrew" => Hebrew),
49 /// Indian calendar
50 ("indian" => Indian),
51 /// Hijri calendar
52 ("islamic" => Hijri(HijriCalendarAlgorithm) {
53 ("umalqura" => Umalqura),
54 ("tbla" => Tbla),
55 ("civil" => Civil),
56 ("rgsa" => Rgsa)
57 }),
58 /// ISO calendar (Gregorian calendar using the ISO 8601 calendar week rules)
59 ("iso8601" => Iso8601),
60 /// Japanese Imperial calendar
61 ("japanese" => Japanese),
62 /// Persian calendar
63 ("persian" => Persian),
64 /// Republic of China calendar
65 ("roc" => Roc)
66}, "ca", s, if *s == value!("islamicc") { return Ok(Self::Hijri(Some(HijriCalendarAlgorithm::Civil))); });