@procore/globalization-toolkit 3.2.0 → 3.3.0
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.
- package/CHANGELOG.md +6 -0
- package/README.md +18 -0
- package/dist/getOverrideLocale/GetOverrideLocale.d.ts +1 -1
- package/dist/getOverrideLocale/GetOverrideLocale.js +3 -0
- package/dist/getOverrideLocale/GetOverrideLocale.js.map +1 -1
- package/dist/getTranslationsFromLocale/GetTranslationsFromLocale.d.ts +6 -0
- package/dist/getTranslationsFromLocale/GetTranslationsFromLocale.js +27 -0
- package/dist/getTranslationsFromLocale/GetTranslationsFromLocale.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +5 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +110 -45
- package/docs/classes/CurrencyFormatter.html +20 -20
- package/docs/classes/DateTimeFormatter.html +17 -13
- package/docs/classes/NumberFormatter.html +17 -17
- package/docs/functions/formatCurrency.html +4 -4
- package/docs/functions/formatCurrencyToParts.html +4 -4
- package/docs/functions/formatDateTime.html +4 -4
- package/docs/functions/formatDateTimeToLocalISOString.html +5 -0
- package/docs/functions/formatDateTimeToParts.html +4 -4
- package/docs/functions/formatNumber.html +4 -4
- package/docs/functions/formatNumberToParts.html +4 -4
- package/docs/functions/getCurrencySeparators.html +3 -3
- package/docs/functions/getDatePartsWithPlaceholders.html +4 -4
- package/docs/functions/getDatePlaceholder.html +4 -4
- package/docs/functions/getFallbackLocaleList.html +4 -0
- package/docs/functions/getNumberSeparators.html +3 -3
- package/docs/functions/getOverrideLocale.html +6 -0
- package/docs/functions/getStartDayOfTheWeek.html +3 -3
- package/docs/functions/getSupportedCurrencies.html +3 -3
- package/docs/functions/parseCurrency.html +4 -4
- package/docs/functions/parseNumber.html +4 -4
- package/docs/index.html +203 -128
- package/docs/interfaces/CurrencyOptions.html +8 -8
- package/docs/interfaces/DateTimeOptionsBasic.html +4 -4
- package/docs/interfaces/DateTimeOptionsComponentsAll.html +14 -14
- package/docs/interfaces/DateTimeOptionsComponentsHourMinute.html +14 -14
- package/docs/interfaces/DateTimeOptionsComponentsHourMinuteSecond.html +14 -14
- package/docs/interfaces/DateTimeOptionsComponentsMonthDay.html +14 -14
- package/docs/interfaces/DateTimeOptionsComponentsWeekdayYearMonthDay.html +14 -14
- package/docs/interfaces/DateTimeOptionsComponentsYearMonth.html +14 -14
- package/docs/interfaces/DateTimeOptionsComponentsYearMonthDay.html +14 -14
- package/docs/interfaces/DateTimeOptionsStyle.html +14 -14
- package/docs/interfaces/NumberOptions.html +6 -6
- package/docs/modules.html +69 -66
- package/docs/types/CurrencyDisplay.html +1 -1
- package/docs/types/CurrencySign.html +1 -1
- package/docs/types/DateLabelOptions.html +1 -1
- package/docs/types/DateStyle.html +1 -1
- package/docs/types/DateTimeFormatPart.html +1 -1
- package/docs/types/DateTimeOptions.html +1 -1
- package/docs/types/DateTimeStyle.html +1 -1
- package/docs/types/Day.html +1 -1
- package/docs/types/FormatterOptions.html +1 -1
- package/docs/types/Hour.html +1 -1
- package/docs/types/Locale.html +1 -1
- package/docs/types/Minute.html +1 -1
- package/docs/types/Month.html +1 -1
- package/docs/types/NumberFormatPart.html +1 -1
- package/docs/types/NumericTwoDigit.html +1 -1
- package/docs/types/Percent.html +1 -1
- package/docs/types/Second.html +1 -1
- package/docs/types/Separators.html +1 -1
- package/docs/types/TimeStyle.html +1 -1
- package/docs/types/TimeZoneName.html +1 -1
- package/docs/types/Weekday.html +1 -1
- package/docs/types/Year.html +1 -1
- package/docs/variables/CurrencyDisplay-1.html +1 -1
- package/docs/variables/CurrencySign-1.html +1 -1
- package/docs/variables/DateStyle-1.html +1 -1
- package/docs/variables/DateTimeStyle-1.html +1 -1
- package/docs/variables/Day-1.html +1 -1
- package/docs/variables/Hour-1.html +1 -1
- package/docs/variables/Minute-1.html +1 -1
- package/docs/variables/Month-1.html +1 -1
- package/docs/variables/NumericTwoDigit-1.html +1 -1
- package/docs/variables/Percent-1.html +1 -1
- package/docs/variables/Second-1.html +1 -1
- package/docs/variables/TimeStyle-1.html +1 -1
- package/docs/variables/TimeZoneName-1.html +1 -1
- package/docs/variables/Weekday-1.html +1 -1
- package/docs/variables/Year-1.html +1 -1
- package/package.json +1 -1
package/docs/index.html
CHANGED
|
@@ -1,28 +1,72 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@procore/globalization-toolkit</title><meta name="description" content="Documentation for @procore/globalization-toolkit"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@procore/globalization-toolkit</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>@procore/globalization-toolkit</h2></div><div class="tsd-panel tsd-typography"><a id="md:globalization-toolkit" class="tsd-anchor"></a><h1 class="tsd-anchor-link">globalization-toolkit<a href="#md:globalization-toolkit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>i18n formatting library</p>
|
|
2
2
|
<p><a href="https://procoretech.slack.com/archives/C037J98SPHD"><img src="https://img.shields.io/badge/Maintainer-team--global--by--design-orange" alt="Maintainer"></a>
|
|
3
|
-
<a href="https://circleci.com/gh/procore/globalization-toolkit/tree/main"><img src="https://circleci.com/gh/procore/globalization-toolkit/tree/main.svg?style=shield&circle-token=2f3787c62ef88e345956761b9d6e243f043a08a7" alt="CircleCI"></a>
|
|
3
|
+
<a href="https://circleci.com/gh/procore/globalization-toolkit/tree/main"><img src="https://circleci.com/gh/procore/globalization-toolkit/tree/main.svg?style=shield&circle-token=2f3787c62ef88e345956761b9d6e243f043a08a7" alt="CircleCI"></a>
|
|
4
4
|
<a href="https://www.npmjs.com/package/@procore/globalization-toolkit"><img src="https://img.shields.io/badge/NPM-%40procore%2Fglobalization--toolkit-blue" alt="NPM"></a></p>
|
|
5
|
-
<p>Before implementing the Globalization Toolkit (GTK), please review the <a href="https://lucid.app/lucidchart/47c65380-9d87-409a-a15e-77c668e4c474/edit?invitationId=inv_abb5b5f8-3d6f-499f-920d-6dc6b7c9734c&page=0_0#">Globalization Toolkit Adoption Diagram</a> to determine the best implementation strategy for you. Continue reading for instructions on direct usage of the GTK
|
|
6
|
-
<a id="md:engineering-documentation" class="tsd-anchor"></a><h2
|
|
5
|
+
<p>Before implementing the Globalization Toolkit (GTK), please review the <a href="https://lucid.app/lucidchart/47c65380-9d87-409a-a15e-77c668e4c474/edit?invitationId=inv_abb5b5f8-3d6f-499f-920d-6dc6b7c9734c&page=0_0#">Globalization Toolkit Adoption Diagram</a> to determine the best implementation strategy for you. Continue reading for instructions on direct usage of the GTK.</p>
|
|
6
|
+
<a id="md:engineering-documentation" class="tsd-anchor"></a><h2 class="tsd-anchor-link"><a href="https://procore.github.io/globalization-toolkit/">Engineering Documentation</a><a href="#md:engineering-documentation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The engineering documentation contains technical documentation for the GTK repo. It details classes, types, interfaces, and features. Continue reading for install and usage instructions.
|
|
7
7
|
Further reading on the GTK:</p>
|
|
8
8
|
<ul>
|
|
9
9
|
<li><a href="https://docs.google.com/presentation/d/1FtB2DR5qroKgGcxxWsu5Ac9QHA01I7WM75FUeB67izE/edit?usp=sharing">GTK Adoption Training Presentation</a></li>
|
|
10
10
|
<li><a href="https://github.com/procore/system-design-records/blob/main/lifecycle/2-pilot/internationalization/0002-globalization-toolkit.md">GTK SDR</a></li>
|
|
11
11
|
<li><a href="https://github.com/procore/globalization-toolkit/blob/41ada23bfa8956c68a7c853da70ec11f766b417a/FAQ.md">GTK FAQ</a></li>
|
|
12
12
|
</ul>
|
|
13
|
-
<a id="md:install" class="tsd-anchor"></a><h2
|
|
14
|
-
<pre><code class="
|
|
15
|
-
</code><button>Copy</button></pre>
|
|
13
|
+
<a id="md:install" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Install<a href="#md:install" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>NPM</p>
|
|
14
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">i</span><span class="hl-1"> </span><span class="hl-3">--save</span><span class="hl-1"> </span><span class="hl-2">@procore/globalization-toolkit</span>
|
|
15
|
+
</code><button type="button">Copy</button></pre>
|
|
16
|
+
|
|
16
17
|
<p>YARN</p>
|
|
17
|
-
<pre><code class="
|
|
18
|
-
</code><button>Copy</button></pre>
|
|
19
|
-
|
|
20
|
-
<a id="md:
|
|
21
|
-
<a id="md:
|
|
18
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">yarn</span><span class="hl-1"> </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-2">@procore/globalization-toolkit</span>
|
|
19
|
+
</code><button type="button">Copy</button></pre>
|
|
20
|
+
|
|
21
|
+
<a id="md:usage" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Usage<a href="#md:usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The GTK has 3 available classes: <code>NumberFormatter</code>, <code>DateTimeFormatter</code>, <code>CurrencyFormatter</code>. The structure of the GTK Library allows for instantiation of a formatting class with defined options. The instantiated class gives access to related functions. In addition, the GTK makes the class functions available as stand-alone functions. Below are examples of GTK usage with class formatter and with stand-alone functions.</p>
|
|
22
|
+
<a id="md:sanitizing-locales" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Sanitizing Locales<a href="#md:sanitizing-locales" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The GTK supports industry standard locale codes, which means some locales used in the Procore app will not work with the GTK or may not work as expected. For example, the GTK does NOT support <a href="https://procoretech.atlassian.net/wiki/spaces/PLATFORM/pages/1039111578/Levels+of+Support+for+Locales+Product+Coverage#Custom-Locales">Procore Custom Locales</a>. When implementing the GTK, please sanitize the locale to follow industry standard of <code><language>-<region></code> like <code>en-US</code>.</p>
|
|
23
|
+
<p>Suggested sanitizations:</p>
|
|
24
|
+
<table>
|
|
25
|
+
<thead>
|
|
26
|
+
<tr>
|
|
27
|
+
<th>User Locale</th>
|
|
28
|
+
<th>Locale Passed to GTK</th>
|
|
29
|
+
<th>Reason</th>
|
|
30
|
+
</tr>
|
|
31
|
+
</thead>
|
|
32
|
+
<tbody>
|
|
33
|
+
<tr>
|
|
34
|
+
<td><code>en-international</code></td>
|
|
35
|
+
<td><code>en-GB</code></td>
|
|
36
|
+
<td>Custom locales are not supported</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td><code>en-owner</code></td>
|
|
40
|
+
<td><code>en-US</code></td>
|
|
41
|
+
<td>Custom locales are not supported</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<tr>
|
|
44
|
+
<td><code>en-owner-beta</code></td>
|
|
45
|
+
<td><code>en-US</code></td>
|
|
46
|
+
<td>Custom locales are not supported</td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<td><code>en-specialty-contractor</code></td>
|
|
50
|
+
<td><code>en-US</code></td>
|
|
51
|
+
<td>Custom locales are not supported</td>
|
|
52
|
+
</tr>
|
|
53
|
+
<tr>
|
|
54
|
+
<td><code>en</code></td>
|
|
55
|
+
<td><code>en-US</code></td>
|
|
56
|
+
<td><code>en</code> will work as expected, but prefer <code><language>-<region></code> format</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td><code>es</code></td>
|
|
60
|
+
<td><code>es-419</code></td>
|
|
61
|
+
<td><code>es</code> is used for Latin America in the monolith but will format numbers like <code>es-ES</code> in the GTK if the region is not specified</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</tbody>
|
|
64
|
+
</table>
|
|
65
|
+
<a id="md:numberformatter-class" class="tsd-anchor"></a><h3 class="tsd-anchor-link">NumberFormatter Class<a href="#md:numberformatter-class" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The GTK <code>NumberFormatter</code> class has the ability to format numbers for a given locale. The <a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter">NumberFormatter</a> class is instantiated with <a href="https://procore.github.io/globalization-toolkit/interfaces/NumberOptions.html">NumberOptions</a> and has 4 available functions:</p>
|
|
22
66
|
<ul>
|
|
23
|
-
<li><code>formatNumber(value: number)</code
|
|
24
|
-
<li><code>formatNumberToParts(value: number)</code
|
|
25
|
-
<li><code>parseNumber(value: string)</code>, and
|
|
67
|
+
<li><code>formatNumber(value: number)</code>,</li>
|
|
68
|
+
<li><code>formatNumberToParts(value: number)</code>,</li>
|
|
69
|
+
<li><code>parseNumber(value: string)</code>, and</li>
|
|
26
70
|
<li><code>getNumberSeparators(locale: string)</code>.</li>
|
|
27
71
|
</ul>
|
|
28
72
|
<p>The <a href="https://procore.github.io/globalization-toolkit/interfaces/CurrencyOptions.html">NumberOptions</a> are summarized below:</p>
|
|
@@ -30,16 +74,19 @@ Further reading on the GTK:</p>
|
|
|
30
74
|
<li><code>locale</code>: string</li>
|
|
31
75
|
<li><code>maximumFractionDigits?</code>: number</li>
|
|
32
76
|
<li><code>minimumFractionDigits?</code>: number</li>
|
|
33
|
-
<li><code>percent?</code>:
|
|
77
|
+
<li><code>percent?</code>: 'standard', 'decimal'</li>
|
|
34
78
|
</ul>
|
|
35
|
-
<p>Below code blocks display usage of the NumberFormatter class and available functions
|
|
36
|
-
<a id="md:formatnumber
|
|
37
|
-
</code><button>Copy</button></pre>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<a id="md:
|
|
79
|
+
<p>Below code blocks display usage of the NumberFormatter class and available functions.</p>
|
|
80
|
+
<a id="md:formatnumber--formatnumbertoparts" class="tsd-anchor"></a><h4 class="tsd-anchor-link"><a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#formatNumber">formatNumber()</a> & <a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#formatNumberToParts">formatNumberToParts()</a><a href="#md:formatnumber--formatnumbertoparts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">NumberFormatter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-7">1234</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">numberOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-US"</span><span class="hl-1">, </span><span class="hl-5">minimumFractionDigits:</span><span class="hl-1"> </span><span class="hl-7">3</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">NumberFormatter</span><span class="hl-1">(</span><span class="hl-5">numberOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatNumber</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">)) </span><span class="hl-8">// expected output: '1,234.000'</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatNumberToParts</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">))</span><br/><span class="hl-1"> </span><span class="hl-8">/**</span><br/><span class="hl-8"> * expected output is an array of objects representing the parts of the formatted number:</span><br/><span class="hl-8"> * [</span><br/><span class="hl-8"> * { type: "integer", value: "1", },</span><br/><span class="hl-8"> * { type: "group", value: ",", },</span><br/><span class="hl-8"> * { type: "integer", value: "234", },</span><br/><span class="hl-8"> * { type: "decimal", value: ".", },</span><br/><span class="hl-8"> * { type: "fraction", value: "000", },</span><br/><span class="hl-8"> * ];</span><br/><span class="hl-8"> */</span>
|
|
81
|
+
</code><button type="button">Copy</button></pre>
|
|
82
|
+
|
|
83
|
+
<a id="md:parsenumber" class="tsd-anchor"></a><h4 class="tsd-anchor-link"><a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#parseNumber">parseNumber()</a><a href="#md:parsenumber" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">NumberFormatter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-2">"123 456 789,12"</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">numberOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"fr-FR"</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">NumberFormatter</span><span class="hl-1">(</span><span class="hl-5">numberOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">parseNumber</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">)); </span><span class="hl-8">// expected output: '123456789.12'</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">parseNumber</span><span class="hl-1">(</span><span class="hl-2">"Abcd"</span><span class="hl-1">)); </span><span class="hl-8">// expected output: NaN</span>
|
|
84
|
+
</code><button type="button">Copy</button></pre>
|
|
85
|
+
|
|
86
|
+
<a id="md:getseparators" class="tsd-anchor"></a><h4 class="tsd-anchor-link"><a href="https://procore.github.io/globalization-toolkit/classes/NumberFormatter.html#getNumberSeparators">getSeparators()</a><a href="#md:getseparators" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">NumberFormatter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">germanNumberOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"de-DE"</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">germanFormatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">NumberFormatter</span><span class="hl-1">(</span><span class="hl-5">germanNumberOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">germanFormatter</span><span class="hl-1">.</span><span class="hl-0">getSeparators</span><span class="hl-1">()); </span><span class="hl-8">// expected output: { decimal: ",", group: "." }</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">usNumberOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">'en-US'</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">NumberFormatter</span><span class="hl-1">(</span><span class="hl-5">usNumberOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">getSeparators</span><span class="hl-1">()); </span><span class="hl-8">// expected output: { decimal: ".", group: "," }</span>
|
|
87
|
+
</code><button type="button">Copy</button></pre>
|
|
88
|
+
|
|
89
|
+
<a id="md:numberformatter-functions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">NumberFormatter Functions<a href="#md:numberformatter-functions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The functions used on the NumberFormatter class are also available as stand alone functions. Read more information about each function in the GTK Documentation.</p>
|
|
43
90
|
<ul>
|
|
44
91
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/formatNumber.html">formatNumber</a></li>
|
|
45
92
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/formatNumberToParts.html">formatNumberToParts</a></li>
|
|
@@ -47,13 +94,15 @@ Further reading on the GTK:</p>
|
|
|
47
94
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/getNumberSeparators.html">getNumberSeparators</a></li>
|
|
48
95
|
</ul>
|
|
49
96
|
<p>The example below shows usage of the stand alone function: <code>formatNumber()</code>.</p>
|
|
50
|
-
<pre><code class="
|
|
51
|
-
</code><button>Copy</button></pre>
|
|
52
|
-
|
|
97
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">formatNumber</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-7">1234</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">numberOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-US"</span><span class="hl-1">, </span><span class="hl-5">minimumFractionDigits:</span><span class="hl-1"> </span><span class="hl-7">3</span><span class="hl-1"> };</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">formatNumber</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">, </span><span class="hl-5">numberOptions</span><span class="hl-1">)) </span><span class="hl-8">// expected output: '1,234.000'</span>
|
|
98
|
+
</code><button type="button">Copy</button></pre>
|
|
99
|
+
|
|
100
|
+
<a id="md:currencyformatter-class" class="tsd-anchor"></a><h3 class="tsd-anchor-link">CurrencyFormatter class<a href="#md:currencyformatter-class" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The GTK CurrencyFormatter class has the ability to format a number with given options. The <a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html">CurrencyFormatter</a> class is instantiated with <a href="https://procore.github.io/globalization-toolkit/interfaces/CurrencyOptions.html">CurrencyOptions</a>.
|
|
101
|
+
The CurrencyFormatter has 5 available functions:</p>
|
|
53
102
|
<ul>
|
|
54
|
-
<li><code>formatCurrency(value: number)</code
|
|
103
|
+
<li><code>formatCurrency(value: number)</code>,</li>
|
|
55
104
|
<li><code>formatCurrencyToParts(value: number)</code></li>
|
|
56
|
-
<li><code>parseCurrency(value: string)</code
|
|
105
|
+
<li><code>parseCurrency(value: string)</code></li>
|
|
57
106
|
<li><code>getCurrencySeparators()</code></li>
|
|
58
107
|
<li><code>getSupportedCurrencies()</code></li>
|
|
59
108
|
</ul>
|
|
@@ -61,34 +110,41 @@ Further reading on the GTK:</p>
|
|
|
61
110
|
<ul>
|
|
62
111
|
<li><code>currencyIsoCode</code>: string (<a href="https://github.com/formatjs/formatjs/blob/main/packages/intl-enumerator/src/currencies.generated.ts">acceptable ISO codes</a>)</li>
|
|
63
112
|
<li><code>locale</code>: string</li>
|
|
64
|
-
<li><code>currencySign?</code>:
|
|
65
|
-
<li><code>currencyDisplay?</code>:
|
|
113
|
+
<li><code>currencySign?</code>: 'accounting', 'standard'</li>
|
|
114
|
+
<li><code>currencyDisplay?</code>: 'code', 'name', 'narrowSymbol', 'symbol'</li>
|
|
66
115
|
<li><code>maximumFractionDigits?</code>: number</li>
|
|
67
116
|
<li><code>minimumFractionDigits?</code>: number</li>
|
|
68
117
|
</ul>
|
|
69
|
-
<p>Below code blocks display usage of the CurrencyFormatter class and available functions
|
|
118
|
+
<p>Below code blocks display usage of the CurrencyFormatter class and available functions.</p>
|
|
70
119
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#formatCurrency">formatCurrency(value: number)</a></p>
|
|
71
|
-
<pre><code class="
|
|
72
|
-
</code><button>Copy</button></pre>
|
|
120
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-7">1234</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-US"</span><span class="hl-1">, </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">"USD"</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatCurrency</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">)) </span><span class="hl-8">// expected outcome: '$1,234.00'</span>
|
|
121
|
+
</code><button type="button">Copy</button></pre>
|
|
122
|
+
|
|
73
123
|
<p>Usage with currencyDisplay option</p>
|
|
74
|
-
<pre><code class="
|
|
75
|
-
</code><button>Copy</button></pre>
|
|
124
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">CurrencyFormatter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-7">1234.567</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1">: </span><span class="hl-9">CurrencyOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"de-DE"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">"USD"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencyDisplay:</span><span class="hl-1"> </span><span class="hl-2">"name"</span><span class="hl-1">,</span><br/><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatCurrency</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">)); </span><span class="hl-8">// expected outcome: '1.234,57 US-Dollar'</span>
|
|
125
|
+
</code><button type="button">Copy</button></pre>
|
|
126
|
+
|
|
76
127
|
<p>Usage with minimumFractionDigits and currencyDisplay</p>
|
|
77
|
-
<pre><code class="
|
|
78
|
-
</code><button>Copy</button></pre>
|
|
128
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-7">1234.567</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"ja-JP"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">minimumFractionDigits:</span><span class="hl-1"> </span><span class="hl-7">2</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">"JPY"</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatCurrency</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">)); </span><span class="hl-8">// expected outcome: '¥1,234.57'</span>
|
|
129
|
+
</code><button type="button">Copy</button></pre>
|
|
130
|
+
|
|
79
131
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#formatCurrencyToParts">formatCurrencyToParts()</a></p>
|
|
80
|
-
<pre><code class="
|
|
81
|
-
</code><button>Copy</button></pre>
|
|
132
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">CurrencyFormatter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = -</span><span class="hl-7">1234.56</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1">: </span><span class="hl-9">CurrencyOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-US"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">"CAD"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencySign:</span><span class="hl-1"> </span><span class="hl-2">"accounting"</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatCurrencyToParts</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">));</span><br/><span class="hl-1"> </span><span class="hl-8">/** expected output:</span><br/><span class="hl-8"> * [</span><br/><span class="hl-8"> * { type: "literal", value: "(", },</span><br/><span class="hl-8"> * { type: "currency", value: "CA$", },</span><br/><span class="hl-8"> * { type: "integer", value: "1", },</span><br/><span class="hl-8"> * { type: "group", value: ",", },</span><br/><span class="hl-8"> * { type: "integer", value: "234", },</span><br/><span class="hl-8"> * { type: "decimal", value: ".", },</span><br/><span class="hl-8"> * { type: "fraction", value: "56", },</span><br/><span class="hl-8"> * { type: "literal", value: ")", },</span><br/><span class="hl-8"> * ]</span><br/><span class="hl-8"> **/</span>
|
|
133
|
+
</code><button type="button">Copy</button></pre>
|
|
134
|
+
|
|
82
135
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#parseCurrency">parseCurrency(value: string)</a></p>
|
|
83
|
-
<pre><code class="
|
|
84
|
-
</code><button>Copy</button></pre>
|
|
136
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-2">"(1 234 567,56 €)"</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1">: </span><span class="hl-9">CurrencyOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"fr-FR"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">"EUR"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">currencySign:</span><span class="hl-1"> </span><span class="hl-2">"accounting"</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">parseCurrency</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">)); </span><span class="hl-8">// expected outcome: -1234567.56</span>
|
|
137
|
+
</code><button type="button">Copy</button></pre>
|
|
138
|
+
|
|
85
139
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#getCurrencySeparators">getCurrencySeparators</a></p>
|
|
86
|
-
<pre><code class="
|
|
87
|
-
</code><button>Copy</button></pre>
|
|
140
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"de-DE"</span><span class="hl-1">, </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">"EUR"</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">getCurrencySeparators</span><span class="hl-1">()) </span><span class="hl-8">// expected outcome: { decimal: ",", group: "." }</span>
|
|
141
|
+
</code><button type="button">Copy</button></pre>
|
|
142
|
+
|
|
88
143
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/CurrencyFormatter.html#getSupportedCurrencies">getSupportedCurrencies</a></p>
|
|
89
|
-
<pre><code class="
|
|
90
|
-
</code><button>Copy</button></pre>
|
|
91
|
-
|
|
144
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"es-MX"</span><span class="hl-1">, </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-6">MXN</span><span class="hl-2">" </span><span class="hl-10">}</span><br/><span class="hl-5">const</span><span class="hl-1"> </span><span class="hl-5">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">CurrencyFormatter</span><span class="hl-1">(</span><span class="hl-5">currencyOption</span><span class="hl-1">)</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">getSupportedCurrencies</span><span class="hl-1">())</span><br/><span class="hl-1"> </span><span class="hl-8">/** expected outcome</span><br/><span class="hl-8"> * [</span><br/><span class="hl-8"> * "AED",</span><br/><span class="hl-8"> * "AFN",</span><br/><span class="hl-8"> * "ALL",</span><br/><span class="hl-8"> * ...</span><br/><span class="hl-8"> * ...</span><br/><span class="hl-8"> * "ZWL"</span><br/><span class="hl-8"> * ]</span><br/><span class="hl-8"> */</span>
|
|
145
|
+
</code><button type="button">Copy</button></pre>
|
|
146
|
+
|
|
147
|
+
<a id="md:currencyformatter-functions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">CurrencyFormatter Functions<a href="#md:currencyformatter-functions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The functions used on the CurrencyFormatter class are also available as stand alone functions. Read more information about each function in the GTK Documentation.</p>
|
|
92
148
|
<ul>
|
|
93
149
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/formatCurrency.html">formatCurrency</a></li>
|
|
94
150
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/formatCurrencyToParts.html">formatCurrencyToParts</a></li>
|
|
@@ -96,117 +152,136 @@ Further reading on the GTK:</p>
|
|
|
96
152
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/getCurrencySeparators.html">getCurrencySeparators</a></li>
|
|
97
153
|
</ul>
|
|
98
154
|
<p>The example below shows usage of the stand alone function: <code>formatCurrency(value, options)</code>.</p>
|
|
99
|
-
<pre><code class="
|
|
100
|
-
</code><button>Copy</button></pre>
|
|
101
|
-
|
|
155
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">formatCurrency</span><span class="hl-1">, </span><span class="hl-5">getCurrencySeparators</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-7">1234</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">currencyOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">'en-US'</span><span class="hl-1">, </span><span class="hl-5">currencyIsoCode:</span><span class="hl-1"> </span><span class="hl-2">'USD'</span><span class="hl-1"> };</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">formatCurrency</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">, </span><span class="hl-5">currencyOptions</span><span class="hl-1">)) </span><span class="hl-8">// expected output: '$1,234.00'</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">getCurrencySeparators</span><span class="hl-1">(</span><span class="hl-5">currencyOptions</span><span class="hl-1">)) </span><span class="hl-8">// expected output: { decimal: ".", group: "," }</span>
|
|
156
|
+
</code><button type="button">Copy</button></pre>
|
|
157
|
+
|
|
158
|
+
<a id="md:datetimeformatter" class="tsd-anchor"></a><h3 class="tsd-anchor-link">DateTimeFormatter<a href="#md:datetimeformatter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The GTK DateTimeFormatter class has the ability to format date and time for the correct timezone. The <a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html">DateTimeFormatter</a> class is instantiated with <a href="https://procore.github.io/globalization-toolkit/types/DateTimeOptions.html">DateTimeOptions</a>.
|
|
159
|
+
The DateTimeFormatter has 3 available functions:</p>
|
|
102
160
|
<ul>
|
|
103
|
-
<li><code>formatDateTime(value: Date)</code
|
|
161
|
+
<li><code>formatDateTime(value: Date)</code>,</li>
|
|
104
162
|
<li><code>formatDateTimeToParts(value: Date)</code>, and</li>
|
|
105
163
|
<li><code>getStartDayOfTheWeek()</code></li>
|
|
106
164
|
</ul>
|
|
107
165
|
<p>The DateTimeOptions can be used in two ways, but the two options cannot be combined. This follows the pattern of Intl.DateTimeFormat.</p>
|
|
108
166
|
<ol>
|
|
109
|
-
<li>Style Options
|
|
110
|
-
<
|
|
111
|
-
<li>
|
|
167
|
+
<li>Style Options:
|
|
168
|
+
<ul>
|
|
169
|
+
<li>timeStyle: 'short', 'medium', 'long', 'full'</li>
|
|
170
|
+
<li>dateStyle: 'short', 'medium', 'long', 'full'</li>
|
|
112
171
|
</ul>
|
|
113
172
|
</li>
|
|
114
|
-
<li>Component Options
|
|
115
|
-
<
|
|
116
|
-
<li>
|
|
117
|
-
<li>
|
|
118
|
-
<li>
|
|
119
|
-
<li>
|
|
120
|
-
<li>
|
|
121
|
-
<li>
|
|
173
|
+
<li>Component Options
|
|
174
|
+
<ul>
|
|
175
|
+
<li>weekday: 'long', 'short', 'narrow'</li>
|
|
176
|
+
<li>year: 'numeric', '2-digit'</li>
|
|
177
|
+
<li>month: numeric', '2-digit', 'long', 'short', 'narrow'</li>
|
|
178
|
+
<li>day: 'numeric', '2-digit'</li>
|
|
179
|
+
<li>hour: 'numeric', '2-digit'</li>
|
|
180
|
+
<li>minute: 'numeric', '2-digit'</li>
|
|
181
|
+
<li>second: 'numeric', '2-digit'</li>
|
|
122
182
|
</ul>
|
|
123
183
|
</li>
|
|
124
184
|
</ol>
|
|
125
|
-
<p>Below code blocks display usage of the DateTimeFormatter class and available functions
|
|
126
|
-
<
|
|
127
|
-
</
|
|
185
|
+
<p>Below code blocks display usage of the DateTimeFormatter class and available functions.
|
|
186
|
+
<a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html#formatDateTime">formatDateTime(value: Date)</a>
|
|
187
|
+
SIMPLE OPTIONS</p>
|
|
188
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">DateTimeFormatter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Date</span><span class="hl-1">(</span><span class="hl-7">1445419756738</span><span class="hl-1">);</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">dateTimeOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">'en-US'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeZone:</span><span class="hl-1"> </span><span class="hl-2">'UTC'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">dateStyle:</span><span class="hl-1"> </span><span class="hl-2">'full'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeStyle:</span><span class="hl-1"> </span><span class="hl-2">'long'</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">DateTimeFormatter</span><span class="hl-1">(</span><span class="hl-5">dateTimeOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatDateTime</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">))</span><br/><span class="hl-8">// expected output: Wednesday, October 21, 2015 at 9:29:16 AM UTC</span>
|
|
189
|
+
</code><button type="button">Copy</button></pre>
|
|
190
|
+
|
|
128
191
|
<p>COMPLEX OPTIONS</p>
|
|
129
|
-
<pre><code class="
|
|
130
|
-
</code><button>Copy</button></pre>
|
|
192
|
+
<pre><code class="js"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Date</span><span class="hl-1">(</span><span class="hl-5">Date</span><span class="hl-1">.</span><span class="hl-0">UTC</span><span class="hl-1">(</span><span class="hl-7">1885</span><span class="hl-1">, </span><span class="hl-7">8</span><span class="hl-1">, </span><span class="hl-7">1</span><span class="hl-1">, </span><span class="hl-7">12</span><span class="hl-1">, </span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-7">16</span><span class="hl-1">, </span><span class="hl-7">738</span><span class="hl-1">));</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">dateTimeOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">'en-US'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeZone:</span><span class="hl-1"> </span><span class="hl-2">'UTC'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">weekday:</span><span class="hl-1"> </span><span class="hl-2">'long'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">year:</span><span class="hl-1"> </span><span class="hl-2">'numeric'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">month:</span><span class="hl-1"> </span><span class="hl-2">'2-digit'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">day:</span><span class="hl-1"> </span><span class="hl-2">'2-digit'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">hour:</span><span class="hl-1"> </span><span class="hl-2">'numeric'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">minute:</span><span class="hl-1"> </span><span class="hl-2">'2-digit'</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">second:</span><span class="hl-1"> </span><span class="hl-2">'2-digit'</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">DateTimeFormatter</span><span class="hl-1">(</span><span class="hl-5">dateTimeOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatDateTime</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">))</span><br/><span class="hl-8">// expected output: "Tuesday, 09/01/1885, 12:00:16 PM";</span>
|
|
193
|
+
</code><button type="button">Copy</button></pre>
|
|
194
|
+
|
|
131
195
|
<p><a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html#formatDateTimeToParts">formatDateTimeToParts(value: Date)</a></p>
|
|
132
|
-
<pre><code class="
|
|
133
|
-
</code><button>Copy</button></pre>
|
|
134
|
-
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
196
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Date</span><span class="hl-1">(</span><span class="hl-5">Date</span><span class="hl-1">.</span><span class="hl-0">UTC</span><span class="hl-1">(</span><span class="hl-7">1955</span><span class="hl-1">, </span><span class="hl-7">10</span><span class="hl-1">, </span><span class="hl-7">5</span><span class="hl-1">, </span><span class="hl-7">6</span><span class="hl-1">, </span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-7">16</span><span class="hl-1">, </span><span class="hl-7">738</span><span class="hl-1">));</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">dateTimeOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-GB"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeZone:</span><span class="hl-1"> </span><span class="hl-2">"UTC"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">dateStyle:</span><span class="hl-1"> </span><span class="hl-5">DateStyle</span><span class="hl-1">.</span><span class="hl-6">FULL</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeStyle:</span><span class="hl-1"> </span><span class="hl-5">TimeStyle</span><span class="hl-1">.</span><span class="hl-6">SHORT</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">DateTimeFormatter</span><span class="hl-1">(</span><span class="hl-5">dateTimeOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatDateTime</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">))</span><br/><span class="hl-1"> </span><span class="hl-8">/** expected output:</span><br/><span class="hl-8"> * [ { type: "weekday", value: "Saturday", },</span><br/><span class="hl-8"> * { type: "literal", value: ", ", },</span><br/><span class="hl-8"> * { type: "day", value: "5", },</span><br/><span class="hl-8"> * { type: "literal", value: " ", },</span><br/><span class="hl-8"> * { type: "month", value: "November", },</span><br/><span class="hl-8"> * { type: "literal", value: " ", },</span><br/><span class="hl-8"> * { type: "year", value: "1955", },</span><br/><span class="hl-8"> * { type: "literal", value: " at ",},</span><br/><span class="hl-8"> * { type: "hour", value: "06",},</span><br/><span class="hl-8"> * { type: "literal", value: ":",},</span><br/><span class="hl-8"> * { type: "minute", value: "00",}, ];</span><br/><span class="hl-8"> **/</span>
|
|
197
|
+
</code><button type="button">Copy</button></pre>
|
|
198
|
+
|
|
199
|
+
<p>[formatDateTimeToLocalISOString(value: Date)]
|
|
200
|
+
This function returns a local ISO 8601 string.
|
|
201
|
+
This method was designed only for internal purposes.
|
|
202
|
+
Must not be used to display dates in the Procore UI.</p>
|
|
203
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Date</span><span class="hl-1">(</span><span class="hl-5">Date</span><span class="hl-1">.</span><span class="hl-0">UTC</span><span class="hl-1">(</span><span class="hl-7">1955</span><span class="hl-1">, </span><span class="hl-7">10</span><span class="hl-1">, </span><span class="hl-7">5</span><span class="hl-1">, </span><span class="hl-7">6</span><span class="hl-1">, </span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-7">16</span><span class="hl-1">, </span><span class="hl-7">738</span><span class="hl-1">));</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">dateTimeOptions</span><span class="hl-1"> = {</span><br/><span class="hl-1"> </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-GB"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeZone:</span><span class="hl-1"> </span><span class="hl-2">"UTC"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">dateStyle:</span><span class="hl-1"> </span><span class="hl-5">DateStyle</span><span class="hl-1">.</span><span class="hl-6">FULL</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">timeStyle:</span><span class="hl-1"> </span><span class="hl-5">TimeStyle</span><span class="hl-1">.</span><span class="hl-6">SHORT</span><span class="hl-1">,</span><br/><span class="hl-1">};</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">DateTimeFormatter</span><span class="hl-1">(</span><span class="hl-5">dateTimeOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">formatDateTimeToLocalISOString</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">))</span><br/><span class="hl-8">// expected output: "1955-11-05";</span>
|
|
204
|
+
</code><button type="button">Copy</button></pre>
|
|
205
|
+
|
|
206
|
+
<p><a href="https://procore.github.io/globalization-toolkit/classes/DateTimeFormatter.html#getStartDayOfTheWeek">getStartDayOfTheWeek()</a>
|
|
207
|
+
This function returns an index value representing the start day of the week on the locale's calendar { Sunday: 0, Monday: 1 ...etc }</p>
|
|
208
|
+
<pre><code class="ts"><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">dateTimeOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">'en-US'</span><span class="hl-1"> };</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">formatter</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">DateTimeFormatter</span><span class="hl-1">(</span><span class="hl-5">dateTimeOptions</span><span class="hl-1">);</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">formatter</span><span class="hl-1">.</span><span class="hl-0">startDayOfTheWeek</span><span class="hl-1">()); </span><span class="hl-8">// expected output: 0</span>
|
|
209
|
+
</code><button type="button">Copy</button></pre>
|
|
210
|
+
|
|
211
|
+
<a id="md:datetimeformatter-functions" class="tsd-anchor"></a><h3 class="tsd-anchor-link">DateTimeFormatter Functions<a href="#md:datetimeformatter-functions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The functions used on the DateTimeFormatter class are also available as stand alone functions. Read more information about each function in the GTK Documentation.</p>
|
|
138
212
|
<ul>
|
|
139
213
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/formatDateTime.html">formatDateTime()</a></li>
|
|
140
214
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/formatDateTimeToParts.html">formaDateTimeToParts()</a></li>
|
|
141
215
|
<li><a href="https://procore.github.io/globalization-toolkit/functions/getStartDayOfTheWeek.html">getStartDayOfTheWeek(locale: string)</a></li>
|
|
142
216
|
</ul>
|
|
143
217
|
<p>The example below shows usage of the stand alone function: <code>formatDateTime()</code>.</p>
|
|
144
|
-
<pre><code class="
|
|
145
|
-
</code><button>Copy</button></pre>
|
|
146
|
-
|
|
218
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">formatDateTime</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">value</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Date</span><span class="hl-1">(</span><span class="hl-5">Date</span><span class="hl-1">.</span><span class="hl-0">UTC</span><span class="hl-1">(</span><span class="hl-7">1955</span><span class="hl-1">, </span><span class="hl-7">10</span><span class="hl-1">, </span><span class="hl-7">5</span><span class="hl-1">, </span><span class="hl-7">6</span><span class="hl-1">, </span><span class="hl-7">0</span><span class="hl-1">, </span><span class="hl-7">16</span><span class="hl-1">, </span><span class="hl-7">738</span><span class="hl-1">));</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">dateTimeOptions</span><span class="hl-1"> = { </span><span class="hl-5">locale:</span><span class="hl-1"> </span><span class="hl-2">"en-US"</span><span class="hl-1">, </span><span class="hl-5">timeZone:</span><span class="hl-1"> </span><span class="hl-2">"UTC"</span><span class="hl-1"> };</span><br/><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-0">formatDateTime</span><span class="hl-1">(</span><span class="hl-5">value</span><span class="hl-1">, </span><span class="hl-5">dateTimeOptions</span><span class="hl-1">)) </span><span class="hl-8">// expected output: 11/5/1955</span>
|
|
219
|
+
</code><button type="button">Copy</button></pre>
|
|
220
|
+
|
|
221
|
+
<a id="md:getoverridelocale-function" class="tsd-anchor"></a><h3 class="tsd-anchor-link">GetOverrideLocale Function<a href="#md:getoverridelocale-function" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The getOverrideLocale function returns a mapped locale based on predefined settings.
|
|
222
|
+
If the environment locale isn't directly supported, it provides a fallback from the predefined mappings.</p>
|
|
223
|
+
<p>Note: This override locale is meant for translation and should not be used directly with GTK formatting functions. For formatting, refer to the <a href="#md:sanitizing-locales">Sanitizing Locales</a> section.</p>
|
|
224
|
+
<a id="md:usage-1" class="tsd-anchor"></a><h4 class="tsd-anchor-link">Usage<a href="#md:usage-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Here is an example of how to use the getOverrideLocale function:</p>
|
|
225
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">getOverrideLocale</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-8">// Example 1: Known supported locale</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale1</span><span class="hl-1"> = </span><span class="hl-0">getOverrideLocale</span><span class="hl-1">(</span><span class="hl-2">'ja-JP'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale1</span><span class="hl-1">); </span><span class="hl-8">// Output: ja-JP</span><br/><br/><span class="hl-8">// Example 2: Fallback locale</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale2</span><span class="hl-1"> = </span><span class="hl-0">getOverrideLocale</span><span class="hl-1">(</span><span class="hl-2">'en-AE'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale2</span><span class="hl-1">); </span><span class="hl-8">// Output: en-GB</span><br/><br/><span class="hl-8">// Example 3: Unknown locale</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale3</span><span class="hl-1"> = </span><span class="hl-0">getOverrideLocale</span><span class="hl-1">(</span><span class="hl-2">'unknown'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale3</span><span class="hl-1">); </span><span class="hl-8">// Output: en</span><br/>
|
|
226
|
+
</code><button type="button">Copy</button></pre>
|
|
227
|
+
|
|
228
|
+
<a id="md:getfallbacklocalelist-function" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code>getFallbackLocaleList</code> Function<a href="#md:getfallbacklocalelist-function" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>The <code>getFallbackLocaleList</code> function returns a list of locales which should have translation files loaded in the client, including fallbacks when available in addition to the English source.
|
|
229
|
+
If the environment locale is not supported directly, it overrides the locale according to predefined mappings.</p>
|
|
230
|
+
<p><em><strong>Important</strong></em>
|
|
231
|
+
This method should be only used by clients that don't support custom locales.</p>
|
|
232
|
+
<p>The example below shows usage of the standalone function: <code>getFallbackLocaleList()</code>.</p>
|
|
233
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">getFallbackLocaleList</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">'@procore/globalization-toolkit'</span><span class="hl-1">;</span><br/><br/><span class="hl-8">// Example 1: Known supported locale</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale1</span><span class="hl-1"> = </span><span class="hl-0">getFallbackLocaleList</span><span class="hl-1">(</span><span class="hl-2">'ja-JP'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale1</span><span class="hl-1">); </span><span class="hl-8">// Output: ['ja-JP', 'en']</span><br/><br/><span class="hl-8">// Example 2: Known supported locale with fallback available</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale2</span><span class="hl-1"> = </span><span class="hl-0">getOverrideLocale</span><span class="hl-1">(</span><span class="hl-2">'es-ES'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale2</span><span class="hl-1">); </span><span class="hl-8">// Output: ['es-ES', 'es', 'en']</span><br/><br/><span class="hl-8">// Example 3: Unsupported locale</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale3</span><span class="hl-1"> = </span><span class="hl-0">getOverrideLocale</span><span class="hl-1">(</span><span class="hl-2">'en-AE'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale3</span><span class="hl-1">); </span><span class="hl-8">// Output: ['en-GB', 'en']</span><br/><br/><span class="hl-8">// Example 4: Unknown/Custom locale (eg. en-owner)</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">locale4</span><span class="hl-1"> = </span><span class="hl-0">getOverrideLocale</span><span class="hl-1">(</span><span class="hl-2">'unknown'</span><span class="hl-1">);</span><br/><span class="hl-5">console</span><span class="hl-1">.</span><span class="hl-0">log</span><span class="hl-1">(</span><span class="hl-5">locale4</span><span class="hl-1">); </span><span class="hl-8">// Output: ['en']</span><br/>
|
|
234
|
+
</code><button type="button">Copy</button></pre>
|
|
235
|
+
|
|
236
|
+
<a id="md:polyfills" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Polyfills<a href="#md:polyfills" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The GTK implementation relies heavily on <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl">Intl</a> functionality. This is generally well-supported by browsers, but depending on the browser versions you intend to support and GTK features you plan to use, it may require polyfills. In particular, consumers have seen issues with Safari versions <14.1. If you intend to support older browser versions, we recommend using the <a href="https://formatjs.io/docs/polyfills">Format.JS polyfills</a>, of which <code>NumberFormat</code>, <code>PluralRules</code>, <code>Locale</code>, <code>GetCanonicalLocales</code>, and <code>supportedValuesOf</code> are the ones relevant to GTK. Please reach out if you have questions.</p>
|
|
147
237
|
<hr>
|
|
148
|
-
<a id="md:developing" class="tsd-anchor"></a><h1
|
|
149
|
-
<pre><code class="
|
|
150
|
-
</code><button>Copy</button></pre>
|
|
238
|
+
<a id="md:developing" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Developing<a href="#md:developing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>Install dependencies:</p>
|
|
239
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">install</span>
|
|
240
|
+
</code><button type="button">Copy</button></pre>
|
|
241
|
+
|
|
151
242
|
<p>Prepare project:</p>
|
|
152
|
-
<pre><code class="
|
|
153
|
-
</code><button>Copy</button></pre>
|
|
243
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">prepare</span>
|
|
244
|
+
</code><button type="button">Copy</button></pre>
|
|
245
|
+
|
|
154
246
|
<p>Compile Typescript:</p>
|
|
155
|
-
<pre><code class="
|
|
156
|
-
</code><button>Copy</button></pre>
|
|
247
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">build</span>
|
|
248
|
+
</code><button type="button">Copy</button></pre>
|
|
249
|
+
|
|
157
250
|
<p>(Delete build <code>npm run clean</code>)</p>
|
|
158
|
-
<a id="md:testing" class="tsd-anchor"></a><h2
|
|
159
|
-
</code><button>Copy</button></pre>
|
|
251
|
+
<a id="md:testing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Testing<a href="#md:testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">test</span>
|
|
252
|
+
</code><button type="button">Copy</button></pre>
|
|
253
|
+
|
|
160
254
|
<p>If adding a new supported export (or removing one in a breaking change), update the snapshot test output and commit the change.</p>
|
|
161
|
-
<pre><code class="
|
|
162
|
-
</code><button>Copy</button></pre>
|
|
255
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">test</span><span class="hl-1"> </span><span class="hl-3">--</span><span class="hl-1"> </span><span class="hl-3">-u</span>
|
|
256
|
+
</code><button type="button">Copy</button></pre>
|
|
257
|
+
|
|
163
258
|
<p>To check formatting run <code>npm run lint:check</code> and <code>npm run format:check</code>.</p>
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
<p>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<p>
|
|
176
|
-
<p
|
|
177
|
-
<pre><code class="language-sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">cm</span>
|
|
178
|
-
</code><button>Copy</button></pre>
|
|
179
|
-
<p>(Optional: <a href="https://github.com/commitizen/cz-cli#optional-running-commitizen-on-git-commit">run commitizen on <code>git commit</code></a>)</p>
|
|
180
|
-
<a id="md:certain-commits-are-analyzed-and-mapped-to-versioning-as-follows" class="tsd-anchor"></a><h4><a href="#md:certain-commits-are-analyzed-and-mapped-to-versioning-as-follows">Certain commits are analyzed and mapped to versioning as follows:</a></h4><ul>
|
|
181
|
-
<li><p><code>MAJOR</code> release if <code>BREAKING CHANGE</code> exists in the commit footer.</p>
|
|
182
|
-
</li>
|
|
183
|
-
<li><p><code>MINOR</code> release for commit type <code>feat</code>.</p>
|
|
184
|
-
</li>
|
|
185
|
-
<li><p><code>PATCH</code> release for commit types <code>fix</code> or <code>perf</code>.</p>
|
|
186
|
-
</li>
|
|
187
|
-
<li><p>No release is triggered for all other commit types.
|
|
188
|
-
And commits that do not match any format rules or have <code>no-release</code> as the scope
|
|
189
|
-
will not trigger a release.</p>
|
|
190
|
-
</li>
|
|
191
|
-
</ul>
|
|
192
|
-
<p>Additionally, <code>releaseRules</code> are specified in <code>package.json</code> for specific commits:</p>
|
|
259
|
+
<p>To check dependencies run</p>
|
|
260
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">depcheck</span>
|
|
261
|
+
</code><button type="button">Copy</button></pre>
|
|
262
|
+
|
|
263
|
+
<a id="md:documentation" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Documentation<a href="#md:documentation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p>We auto-generate documentation on what the Globalization Toolkit offers by utilizing <a href="https://typedoc.org/example/"><code>Typedoc</code></a>.
|
|
264
|
+
Once you generate the updated documentation, you can navigate it locally by opening 'docs/index.html'.</p>
|
|
265
|
+
<p>To generate updated documentation run:</p>
|
|
266
|
+
<pre><code class="sh"><span class="hl-0">$</span><span class="hl-1"> </span><span class="hl-2">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">typedoc</span>
|
|
267
|
+
</code><button type="button">Copy</button></pre>
|
|
268
|
+
|
|
269
|
+
<a id="md:versioning-and-publishing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Versioning and Publishing<a href="#md:versioning-and-publishing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>We use <a href="https://github.com/changesets/changesets/"><code>changesets</code></a> to manage releases, and encourage you to include a changeset with each commit or pull request.</p>
|
|
270
|
+
<p>To create a changeset run <code>npm run changeset</code> and follow the prompt instructions.</p>
|
|
271
|
+
<p>To publish a release with changes:</p>
|
|
193
272
|
<ul>
|
|
194
|
-
<li
|
|
195
|
-
<li
|
|
273
|
+
<li>Create new branch (e.g., <code>git checkout -b chore/release</code>).</li>
|
|
274
|
+
<li>Run <code>npm run changeset version</code> to create a release containing all changes. This command will update the version of GTK, as well update the <code>CHANGELOG.md</code> file.</li>
|
|
275
|
+
<li>Commit the changes (e.g., <code>git commit -m "chore: release"</code>).</li>
|
|
276
|
+
<li>Create a pull request. <code>git push -u origin HEAD</code>, and then create pull request in the web UI.</li>
|
|
277
|
+
<li>Once the pull request is merged to <code>main</code> the updated packages will be published to npm once the CI pipeline is completed.</li>
|
|
196
278
|
</ul>
|
|
197
|
-
<
|
|
198
|
-
<a id="md:
|
|
199
|
-
We use <a href="https://semantic-release.gitbook.io/semantic-release/"><code>semantic-release</code></a> to manage releases and publishing to <code>NPM</code>.
|
|
200
|
-
Semantic Release relies on the project's commit history
|
|
201
|
-
to create release notes and determine the next version.</p>
|
|
202
|
-
<a id="md:release-notes" class="tsd-anchor"></a><h3><a href="#md:release-notes">Release Notes:</a></h3><p>The <code><description></code> for commits selected for publishing are added to the release notes
|
|
203
|
-
and can be found in the <strong>Releases</strong> section of Github.</p>
|
|
204
|
-
<a id="md:license" class="tsd-anchor"></a><h2><a href="#md:license">License</a></h2><p>The package is available under the <a href="https://www.procore.com/legal/api-terms-and-conditions">Procore Developers License</a></p>
|
|
205
|
-
<a id="md:about-procore" class="tsd-anchor"></a><h2><a href="#md:about-procore">About Procore</a></h2><p><img
|
|
279
|
+
<a id="md:license" class="tsd-anchor"></a><h2 class="tsd-anchor-link">License<a href="#md:license" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>The package is available under the <a href="https://www.procore.com/legal/api-terms-and-conditions">Procore Developers License</a></p>
|
|
280
|
+
<a id="md:about-procore" class="tsd-anchor"></a><h2 class="tsd-anchor-link">About Procore<a href="#md:about-procore" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p><img
|
|
206
281
|
src="https://www.procore.com/images/procore_logo.png"
|
|
207
282
|
alt="Procore Logo"
|
|
208
283
|
width="250px"
|
|
209
284
|
/></p>
|
|
210
285
|
<p>Procore - building the software that builds the world.</p>
|
|
211
286
|
<p>Learn more about the #1 most widely used construction management software at <a href="https://www.procore.com/">procore.com</a></p>
|
|
212
|
-
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><ul><li><ul><li><a href="#md:globalization-toolkit"><span>globalization-<wbr/>toolkit</span></a></li><li><ul><li><a href="#md:engineering-documentation"><span>Engineering <wbr/>Documentation</span></a></li><li><a href="#md:install"><span>Install</span></a></li><li><a href="#md:usage"><span>Usage</span></a></li><li><ul><li><a href="#md:a-note-on-locales"><span>A <wbr/>Note on <wbr/>Locales</span></a></li><li><a href="#md:numberformatter-class"><span>Number<wbr/>Formatter <wbr/>Class</span></a></li><li><ul><li><a href="#md:formatnumber-amp-formatnumbertoparts"><span>format<wbr/>Number() & format<wbr/>Number<wbr/>To<wbr/>Parts()</span></a></li><li><a href="#md:parsenumber"><span>parse<wbr/>Number()</span></a></li><li><a href="#md:getseparators"><span>get<wbr/>Separators()</span></a></li></ul></li><li><a href="#md:numberformatter-functions"><span>Number<wbr/>Formatter <wbr/>Functions</span></a></li><li><a href="#md:currencyformatter-class"><span>Currency<wbr/>Formatter class</span></a></li><li><a href="#md:currencyformatter-functions"><span>Currency<wbr/>Formatter <wbr/>Functions</span></a></li><li><a href="#md:datetimeformatter"><span>Date<wbr/>Time<wbr/>Formatter</span></a></li><li><a href="#md:datetimeformatter-functions"><span>Date<wbr/>Time<wbr/>Formatter <wbr/>Functions</span></a></li></ul></li><li><a href="#md:polyfills"><span>Polyfills</span></a></li></ul></li><li><a href="#md:developing"><span>Developing</span></a></li><li><ul><li><a href="#md:testing"><span>Testing</span></a></li><li><a href="#md:committing-changes"><span>Committing <wbr/>Changes</span></a></li><li><ul><li><a href="#md:certain-commits-are-analyzed-and-mapped-to-versioning-as-follows"><span>Certain commits are analyzed and mapped to versioning as follows:</span></a></li></ul></li></ul></li><li><a href="#md:publishing"><span>Publishing</span></a></li><li><ul><li><a href="#md:release-notes"><span>Release <wbr/>Notes:</span></a></li><li><a href="#md:license"><span>License</span></a></li><li><a href="#md:about-procore"><span>About <wbr/>Procore</span></a></li></ul></li></ul></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1"></use></svg><span>@procore/globalization-toolkit</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li><a href="classes/CurrencyFormatter.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>CurrencyFormatter</a></li><li><a href="classes/DateTimeFormatter.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>DateTimeFormatter</a></li><li><a href="classes/NumberFormatter.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg>NumberFormatter</a></li><li><a href="interfaces/CurrencyOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>CurrencyOptions</a></li><li><a href="interfaces/DateTimeOptionsBasic.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsBasic</a></li><li><a href="interfaces/DateTimeOptionsComponentsAll.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsAll</a></li><li><a href="interfaces/DateTimeOptionsComponentsHourMinute.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsHourMinute</a></li><li><a href="interfaces/DateTimeOptionsComponentsHourMinuteSecond.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsHourMinuteSecond</a></li><li><a href="interfaces/DateTimeOptionsComponentsMonthDay.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsMonthDay</a></li><li><a href="interfaces/DateTimeOptionsComponentsWeekdayYearMonthDay.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsWeekdayYearMonthDay</a></li><li><a href="interfaces/DateTimeOptionsComponentsYearMonth.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsYearMonth</a></li><li><a href="interfaces/DateTimeOptionsComponentsYearMonthDay.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsComponentsYearMonthDay</a></li><li><a href="interfaces/DateTimeOptionsStyle.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>DateTimeOptionsStyle</a></li><li><a href="interfaces/NumberOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg>NumberOptions</a></li><li><a href="types/CurrencyDisplay.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>CurrencyDisplay</a></li><li><a href="types/CurrencySign.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>CurrencySign</a></li><li><a href="types/DateLabelOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>DateLabelOptions</a></li><li><a href="types/DateStyle.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>DateStyle</a></li><li><a href="types/DateTimeFormatPart.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>DateTimeFormatPart</a></li><li><a href="types/DateTimeOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>DateTimeOptions</a></li><li><a href="types/DateTimeStyle.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2097152"></use></svg>DateTimeStyle</a></li><li>Loading...</li></ul></nav></div></div></div><div class="tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><svg style="display: none"><g id="icon-1"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-2"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g><g id="icon-16"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)"></path></g><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-8192"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-16384"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-32768"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-65536"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-131072"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-262144"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-524288"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-1048576"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)"></path></g><g id="icon-chevronDown"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></g><g id="icon-chevronSmall"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></g><g id="icon-menu"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></g><g id="icon-search"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></g><g id="icon-anchor"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g></svg></body></html>
|
|
287
|
+
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:globalization-toolkit"><span>globalization-<wbr/>toolkit</span></a><ul><li><a href="#md:engineering-documentation"><span>Engineering <wbr/>Documentation</span></a></li><li><a href="#md:install"><span>Install</span></a></li><li><a href="#md:usage"><span>Usage</span></a></li><li><ul><li><a href="#md:sanitizing-locales"><span>Sanitizing <wbr/>Locales</span></a></li><li><a href="#md:numberformatter-class"><span>Number<wbr/>Formatter <wbr/>Class</span></a></li><li><ul><li><a href="#md:formatnumber--formatnumbertoparts"><span>format<wbr/>Number() & format<wbr/>Number<wbr/>To<wbr/>Parts()</span></a></li><li><a href="#md:parsenumber"><span>parse<wbr/>Number()</span></a></li><li><a href="#md:getseparators"><span>get<wbr/>Separators()</span></a></li></ul></li><li><a href="#md:numberformatter-functions"><span>Number<wbr/>Formatter <wbr/>Functions</span></a></li><li><a href="#md:currencyformatter-class"><span>Currency<wbr/>Formatter class</span></a></li><li><a href="#md:currencyformatter-functions"><span>Currency<wbr/>Formatter <wbr/>Functions</span></a></li><li><a href="#md:datetimeformatter"><span>Date<wbr/>Time<wbr/>Formatter</span></a></li><li><a href="#md:datetimeformatter-functions"><span>Date<wbr/>Time<wbr/>Formatter <wbr/>Functions</span></a></li><li><a href="#md:getoverridelocale-function"><span>Get<wbr/>Override<wbr/>Locale <wbr/>Function</span></a></li><li><ul><li><a href="#md:usage-1"><span>Usage</span></a></li></ul></li><li><a href="#md:getfallbacklocalelist-function"><span>get<wbr/>Fallback<wbr/>Locale<wbr/>List <wbr/>Function</span></a></li></ul></li><li><a href="#md:polyfills"><span>Polyfills</span></a></li></ul><a href="#md:developing"><span>Developing</span></a><ul><li><a href="#md:testing"><span>Testing</span></a></li></ul><a href="#md:documentation"><span>Documentation</span></a><ul><li><a href="#md:versioning-and-publishing"><span>Versioning and <wbr/>Publishing</span></a></li><li><a href="#md:license"><span>License</span></a></li><li><a href="#md:about-procore"><span>About <wbr/>Procore</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="assets/icons.svg#icon-1"></use></svg><span>@procore/globalization-toolkit</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|