intl-messageformat 11.2.14 → 11.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1737,7 +1737,10 @@ function getBestPattern(skeleton, locale) {
1737
1737
  */
1738
1738
  function getDefaultHourSymbolFromLocale(locale) {
1739
1739
  let hourCycle = locale.hourCycle;
1740
- if (hourCycle === void 0 && locale.hourCycles && locale.hourCycles.length) hourCycle = locale.hourCycles[0];
1740
+ if (hourCycle === void 0) {
1741
+ const localeWithHourCycles = locale;
1742
+ hourCycle = localeWithHourCycles.getHourCycles?.()[0] ?? localeWithHourCycles.hourCycles?.[0];
1743
+ }
1741
1744
  if (hourCycle) switch (hourCycle) {
1742
1745
  case "h24": return "k";
1743
1746
  case "h23": return "H";
@@ -1748,7 +1751,7 @@ function getDefaultHourSymbolFromLocale(locale) {
1748
1751
  const languageTag = locale.language;
1749
1752
  let regionTag;
1750
1753
  if (languageTag !== "root") regionTag = locale.maximize().region;
1751
- return (timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0];
1754
+ return (timeData[`${languageTag}-${regionTag}`] || timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0].charAt(0);
1752
1755
  }
1753
1756
  const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`);
1754
1757
  const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-messageformat",
3
- "version": "11.2.14",
3
+ "version": "11.2.15",
4
4
  "description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",
5
5
  "keywords": [
6
6
  "globalization",
@@ -35,6 +35,6 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@formatjs/fast-memoize": "3.1.7",
38
- "@formatjs/icu-messageformat-parser": "3.5.17"
38
+ "@formatjs/icu-messageformat-parser": "3.5.18"
39
39
  }
40
40
  }