Skip to content

Commit 88467e0

Browse files
jahzielvwbamberg
authored and
wbamberg
committedJul 11, 2019
Intl.Locale.prototype.toString() interactive example (#1389)
* added for await of example! * fixed typo in meta.json that broke build * restructuring example * moved to correct folder 😬 * added toString example * got rid of file that belongs in branch * fixed meta.json * requested changes made! 🎉
1 parent 8096620 commit 88467e0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<pre>
2+
<code id="static-js">const french = new Intl.Locale("fr-Latn-FR", {calendar: "gregory", hourCycle: "h24"});
3+
const korean = new Intl.Locale("ko-Kore-KR", {numeric: true, caseFirst: "upper"});
4+
5+
console.log(french.toString());
6+
// expected output: "fr-Latn-FR-u-ca-gregory-hc-h24"
7+
8+
console.log(korean.toString())
9+
//expected output: "ko-Kore-KR-u-kf-upper-kn"</code>
10+
</pre>

‎live-examples/js-examples/intl/meta.json

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
"title": "JavaScript Demo: Intl.Locale.prototype.minimize()",
7373
"type": "js"
7474
},
75+
"intlLocalePrototypeToString": {
76+
"exampleCode": "./live-examples/js-examples/intl/intl-locale-prototype-tostring.html",
77+
"fileName": "intl-locale-prototype-tostring.html",
78+
"title": "JavaScript Demo: Intl.Locale.prototype.toString()",
79+
"type": "js"
80+
},
7581
"intlNumberFormatPrototypeFormat": {
7682
"exampleCode": "./live-examples/js-examples/intl/intl-numberformat-prototype-format.html",
7783
"fileName": "intl-numberformat-prototype-format.html",

0 commit comments

Comments
 (0)
Please sign in to comment.