Lines Matching defs:hc
38 std::string ToHourCycleString(JSDateTimeFormat::HourCycle hc) {
39 switch (hc) {
55 JSDateTimeFormat::HourCycle ToHourCycle(const std::string& hc) {
56 if (hc == "h11") return JSDateTimeFormat::HourCycle::kH11;
57 if (hc == "h12") return JSDateTimeFormat::HourCycle::kH12;
58 if (hc == "h23") return JSDateTimeFormat::HourCycle::kH23;
59 if (hc == "h24") return JSDateTimeFormat::HourCycle::kH24;
63 JSDateTimeFormat::HourCycle ToHourCycle(UDateFormatHourCycle hc) {
64 switch (hc) {
651 // 5.b.i. Let hc be dtf.[[HourCycle]].
652 HourCycle hc = date_time_format->hour_cycle();
654 if (hc != HourCycle::kUndefined) {
660 switch (hc) {
661 // ii. If hc is "h11" or "h12", let v be true.
670 // iii. Else if, hc is "h23" or "h24", let v be false.
1130 JSDateTimeFormat::HourCycle hc) {
1132 switch (hc) {
1182 icu::DateTimePatternGenerator* generator, JSDateTimeFormat::HourCycle hc) {
1197 pattern = ReplaceHourCycleInPattern(pattern, hc);
1216 JSDateTimeFormat::HourCycle hc) {
1232 CreateICUDateFormat(icu_locale, skeleton, generator, hc));
1245 icu::DateTimePatternGenerator* generator, JSDateTimeFormat::HourCycle hc) {
1249 cache.Pointer()->Create(icu_locale, skeleton, generator, hc));
1276 // We need to pass in the hc to DateIntervalFormat by using Unicode 'hc'
1280 loc.setUnicodeKeywordValue("hc", hcString, status);
1340 JSDateTimeFormat::HourCycle hc) {
1343 switch (hc) {
1390 JSDateTimeFormat::HourCycle hc, icu::DateTimePatternGenerator* generator) {
1425 return DateTimeStylePattern(date_style, time_style, icu_locale, hc,
1429 // Fallback to the locale without "hc".
1430 if (!icu_locale.getUnicodeKeywordValue<std::string>("hc", status).empty()) {
1432 icu_locale.setUnicodeKeywordValue("hc", nullptr, status);
1433 return DateTimeStylePattern(date_style, time_style, icu_locale, hc,
1441 return DateTimeStylePattern(date_style, time_style, icu_locale, hc,
1455 if (hc == HourCycleFromPattern(pattern)) {
1459 return CreateICUDateFormatFromCache(icu_locale, ReplaceSkeleton(skeleton, hc),
1460 generator, hc);
1579 // 9. Set opt.[[hc]] to hourCycle.
1583 // « "ca", "nu", "hc" ».
1584 std::set<std::string> relevant_extension_keys = {"nu", "ca", "hc"};
1621 // Need to keep a copy of icu_locale which not changing "ca", "nu", "hc"
1650 // 16.Let hc be r.[[hc]].
1651 HourCycle hc = HourCycle::kUndefined;
1653 auto hc_extension_it = r.extensions.find("hc");
1655 hc = ToHourCycle(hc_extension_it->second.c_str());
1658 hc = hour_cycle;
1660 // 17. If hc is null, then
1661 if (hc == HourCycle::kUndefined) {
1662 // a. Set hc to hcDefault.
1663 hc = hc_default;
1672 // 1. Set hc to "h11".
1673 hc = HourCycle::kH11;
1676 // 1. Set hc to "h12".
1677 hc = HourCycle::kH12;
1683 // 1. Set hc to "h23".
1684 hc = HourCycle::kH23;
1687 // 1. Set hc to "h24".
1688 hc = HourCycle::kH24;
1729 for (const PatternData& item : GetPatternData(hc)) {
1804 // a. Set dateTimeFormat.[[HourCycle]] to hc.
1805 dateTimeFormatHourCycle = hc;
1845 // dataLocaleData, hc).
1859 // v. Set dateTimeFormat.[[HourCycle]] to hc.
1860 dateTimeFormatHourCycle = hc;
1888 // Steps 8-9 set opt.[[hc]] to value *other than undefined*
1901 auto hc_extension_it = r.extensions.find("hc");
1905 // Remove -hc- if it does not agree with what we used.
1907 resolved_locale.setUnicodeKeywordValue("hc", nullptr, status);