globalize-rpk 1.7.0 → 1.7.1
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/globalize/currency.js +590 -0
- package/globalize/date.js +3139 -0
- package/globalize/globalize-runtime.js +326 -0
- package/globalize/globalize.js +507 -0
- package/globalize/message.js +2076 -0
- package/globalize/number.js +1727 -0
- package/globalize/plural.js +376 -0
- package/globalize/relative-time.js +203 -0
- package/globalize/unit.js +301 -0
- package/node-main.js +27 -0
- package/package.json +3 -26
- package/CONTRIBUTING.md +0 -5
- package/README.md +0 -818
- package/doc/api/core/constructor.md +0 -28
- package/doc/api/core/load.md +0 -96
- package/doc/api/core/locale.md +0 -43
- package/doc/api/currency/currency-formatter.md +0 -196
- package/doc/api/currency/currency-to-parts-formatter.md +0 -117
- package/doc/api/date/date-formatter.md +0 -203
- package/doc/api/date/date-parser.md +0 -60
- package/doc/api/date/date-to-parts-formatter.md +0 -176
- package/doc/api/date/load-iana-time-zone.md +0 -29
- package/doc/api/message/load-messages.md +0 -105
- package/doc/api/message/message-formatter.md +0 -208
- package/doc/api/number/number-formatter.md +0 -202
- package/doc/api/number/number-parser.md +0 -130
- package/doc/api/number/number-to-parts-formatter.md +0 -140
- package/doc/api/plural/plural-generator.md +0 -84
- package/doc/api/relative-time/relative-time-formatter.md +0 -60
- package/doc/api/unit/unit-formatter.md +0 -72
- package/doc/blog-post/2017-07-xx-1.3.0-announcement.md +0 -177
- package/doc/cldr.md +0 -114
- package/doc/error/e-default-locale-not-defined.md +0 -9
- package/doc/error/e-invalid-cldr.md +0 -14
- package/doc/error/e-invalid-par-type.md +0 -12
- package/doc/error/e-invalid-par-value.md +0 -11
- package/doc/error/e-missing-cldr.md +0 -11
- package/doc/error/e-missing-parameter.md +0 -10
- package/doc/error/e-missing-plural-module.md +0 -9
- package/doc/error/e-par-missing-key.md +0 -11
- package/doc/error/e-par-out-of-range.md +0 -13
- package/doc/error/e-unsupported.md +0 -10
- package/doc/migrating-from-0.x.md +0 -64
- package/examples/amd-bower/.bowerrc +0 -7
- package/examples/amd-bower/README.md +0 -65
- package/examples/amd-bower/bower.json +0 -13
- package/examples/amd-bower/index.html +0 -46
- package/examples/amd-bower/main.js +0 -141
- package/examples/amd-bower/messages/en.json +0 -12
- package/examples/amd-bower/package.json +0 -14
- package/examples/app-npm-webpack/README.md +0 -74
- package/examples/app-npm-webpack/app/index.js +0 -89
- package/examples/app-npm-webpack/index-template.html +0 -71
- package/examples/app-npm-webpack/messages/ar.json +0 -25
- package/examples/app-npm-webpack/messages/de.json +0 -21
- package/examples/app-npm-webpack/messages/en.json +0 -21
- package/examples/app-npm-webpack/messages/es.json +0 -21
- package/examples/app-npm-webpack/messages/pt.json +0 -21
- package/examples/app-npm-webpack/messages/ru.json +0 -23
- package/examples/app-npm-webpack/messages/zh.json +0 -20
- package/examples/app-npm-webpack/package.json +0 -17
- package/examples/app-npm-webpack/webpack-config.js +0 -63
- package/examples/globalize-compiler/README.md +0 -45
- package/examples/globalize-compiler/app.js +0 -58
- package/examples/globalize-compiler/development.html +0 -121
- package/examples/globalize-compiler/messages.json +0 -12
- package/examples/globalize-compiler/package.json +0 -15
- package/examples/globalize-compiler/production.html +0 -75
- package/examples/node-npm/README.md +0 -57
- package/examples/node-npm/main.js +0 -65
- package/examples/node-npm/messages/en.json +0 -12
- package/examples/node-npm/package.json +0 -10
- package/examples/plain-javascript/README.md +0 -81
- package/examples/plain-javascript/index.html +0 -445
@@ -1,445 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<head>
|
3
|
-
<meta charset="utf-8">
|
4
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
5
|
-
<title>Globalize Hello World (plain javascript)</title>
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
<h1>Globalize Hello World (plain javascript)</h1>
|
9
|
-
|
10
|
-
<div id="requirements">
|
11
|
-
<h2>Requirements</h2>
|
12
|
-
<ul>
|
13
|
-
<li>You need to download `cldrjs` and `globalize` dependencies yourself. Read README.md for instructions.
|
14
|
-
</li>
|
15
|
-
</ul>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div id="demo" style="display: none">
|
19
|
-
<h2>Demo output</h2>
|
20
|
-
<p>Now: <span id="date"></span></p>
|
21
|
-
<p>Now: <span id="dateToParts"></span> (note the highlighted month, the markup was added using formatDateToParts)</p>
|
22
|
-
<p>Now (in America/Sao_Paulo): <span id="zonedDate"></span></p>
|
23
|
-
<p>A number: <span id="number"></span></p>
|
24
|
-
<p>A number (compact form): <span id="number-compact"></span></p>
|
25
|
-
<p>A currency: <span id="currency"></span></p>
|
26
|
-
<p>Plural form of <span id="plural-number"></span> is <span id="plural-form"></span></p>
|
27
|
-
<p>Messages:</p>
|
28
|
-
<ul>
|
29
|
-
<li><span id="message-0"></span></li>
|
30
|
-
<li><span id="message-1"></span></li>
|
31
|
-
<li><span id="message-2"></span></li>
|
32
|
-
<li><span id="message-3"></span></li>
|
33
|
-
</ul>
|
34
|
-
<p>Something happened: <span id="relative-time"></span></p>
|
35
|
-
<p>Speed limit: <span id="unit"></span></p>
|
36
|
-
</div>
|
37
|
-
|
38
|
-
<!--
|
39
|
-
First, we load Globalize's dependencies (`cldrjs` and its supplemental
|
40
|
-
module).
|
41
|
-
-->
|
42
|
-
<script src="cldrjs/dist/cldr.js"></script>
|
43
|
-
<script src="cldrjs/dist/cldr/event.js"></script>
|
44
|
-
<script src="cldrjs/dist/cldr/supplemental.js"></script>
|
45
|
-
|
46
|
-
<!--
|
47
|
-
Next, we load Globalize and its modules. Note they are already available on
|
48
|
-
this repository. If it's not, read Usage on Getting Started on the root's
|
49
|
-
README.md.
|
50
|
-
-->
|
51
|
-
<script src="globalize/dist/globalize.js"></script>
|
52
|
-
<script src="globalize/dist/globalize/message.js"></script>
|
53
|
-
<script src="globalize/dist/globalize/number.js"></script>
|
54
|
-
<script src="globalize/dist/globalize/plural.js"></script>
|
55
|
-
|
56
|
-
<!-- Load after globalize/number.js -->
|
57
|
-
<script src="globalize/dist/globalize/date.js"></script>
|
58
|
-
<script src="globalize/dist/globalize/currency.js"></script>
|
59
|
-
|
60
|
-
<!-- Load after globalize/number.js and globalize/plural.js-->
|
61
|
-
<script src="globalize/dist/globalize/relative-time.js"></script>
|
62
|
-
<script src="globalize/dist/globalize/unit.js"></script>
|
63
|
-
|
64
|
-
<script>
|
65
|
-
|
66
|
-
// At this point, we have Globalize loaded. But, before we can use it, we
|
67
|
-
// need to feed it on the appropriate I18n content (Unicode CLDR). In order
|
68
|
-
// to do so, we use `Globalize.load()` and pass the content. On this demo,
|
69
|
-
// we made the things a little easier for you: we've embedded static JSON
|
70
|
-
// into the demo. So, you don't need to actually fetch it elsewhere.
|
71
|
-
Globalize.load({
|
72
|
-
"main": {
|
73
|
-
"en": {
|
74
|
-
"identity": {
|
75
|
-
"version": {
|
76
|
-
"_cldrVersion": "25",
|
77
|
-
"_number": "$Revision: 91 $"
|
78
|
-
},
|
79
|
-
"generation": {
|
80
|
-
"_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $"
|
81
|
-
},
|
82
|
-
"language": "en"
|
83
|
-
},
|
84
|
-
"dates": {
|
85
|
-
"calendars": {
|
86
|
-
"gregorian": {
|
87
|
-
"days": {
|
88
|
-
"format": {
|
89
|
-
"wide": {
|
90
|
-
"sun": "Sunday",
|
91
|
-
"mon": "Monday",
|
92
|
-
"tue": "Tuesday",
|
93
|
-
"wed": "Wednesday",
|
94
|
-
"thu": "Thursday",
|
95
|
-
"fri": "Friday",
|
96
|
-
"sat": "Saturday"
|
97
|
-
}
|
98
|
-
}
|
99
|
-
},
|
100
|
-
"months": {
|
101
|
-
"format": {
|
102
|
-
"abbreviated": {
|
103
|
-
"1": "Jan",
|
104
|
-
"2": "Feb",
|
105
|
-
"3": "Mar",
|
106
|
-
"4": "Apr",
|
107
|
-
"5": "May",
|
108
|
-
"6": "Jun",
|
109
|
-
"7": "Jul",
|
110
|
-
"8": "Aug",
|
111
|
-
"9": "Sep",
|
112
|
-
"10": "Oct",
|
113
|
-
"11": "Nov",
|
114
|
-
"12": "Dec"
|
115
|
-
},
|
116
|
-
"wide": {
|
117
|
-
"1": "January",
|
118
|
-
"2": "February",
|
119
|
-
"3": "March",
|
120
|
-
"4": "April",
|
121
|
-
"5": "May",
|
122
|
-
"6": "June",
|
123
|
-
"7": "July",
|
124
|
-
"8": "August",
|
125
|
-
"9": "September",
|
126
|
-
"10": "October",
|
127
|
-
"11": "November",
|
128
|
-
"12": "December"
|
129
|
-
}
|
130
|
-
}
|
131
|
-
},
|
132
|
-
"dayPeriods": {
|
133
|
-
"format": {
|
134
|
-
"wide": {
|
135
|
-
"am": "AM",
|
136
|
-
"am-alt-variant": "am",
|
137
|
-
"noon": "noon",
|
138
|
-
"pm": "PM",
|
139
|
-
"pm-alt-variant": "pm"
|
140
|
-
}
|
141
|
-
}
|
142
|
-
},
|
143
|
-
"dateFormats": {
|
144
|
-
"full": "EEEE, MMMM d, y",
|
145
|
-
"medium": "MMM d, y"
|
146
|
-
},
|
147
|
-
"timeFormats": {
|
148
|
-
"full": "h:mm:ss a zzzz",
|
149
|
-
"medium": "h:mm:ss a",
|
150
|
-
},
|
151
|
-
"dateTimeFormats": {
|
152
|
-
"full": "{1} 'at' {0}",
|
153
|
-
"medium": "{1}, {0}"
|
154
|
-
}
|
155
|
-
}
|
156
|
-
},
|
157
|
-
"fields": {
|
158
|
-
"second": {
|
159
|
-
"displayName": "Second",
|
160
|
-
"relative-type-0": "now",
|
161
|
-
"relativeTime-type-future": {
|
162
|
-
"relativeTimePattern-count-one": "in {0} second",
|
163
|
-
"relativeTimePattern-count-other": "in {0} seconds"
|
164
|
-
},
|
165
|
-
"relativeTime-type-past": {
|
166
|
-
"relativeTimePattern-count-one": "{0} second ago",
|
167
|
-
"relativeTimePattern-count-other": "{0} seconds ago"
|
168
|
-
}
|
169
|
-
}
|
170
|
-
},
|
171
|
-
"timeZoneNames": {
|
172
|
-
"metazone": {
|
173
|
-
"Brasilia": {
|
174
|
-
"long": {
|
175
|
-
"generic": "Brasilia Time",
|
176
|
-
"standard": "Brasilia Standard Time",
|
177
|
-
"daylight": "Brasilia Summer Time"
|
178
|
-
}
|
179
|
-
}
|
180
|
-
}
|
181
|
-
}
|
182
|
-
},
|
183
|
-
"numbers": {
|
184
|
-
"currencies": {
|
185
|
-
"USD": {
|
186
|
-
"symbol": "$"
|
187
|
-
}
|
188
|
-
},
|
189
|
-
"defaultNumberingSystem": "latn",
|
190
|
-
"symbols-numberSystem-latn": {
|
191
|
-
"decimal": ".",
|
192
|
-
"exponential": "E",
|
193
|
-
"group": ",",
|
194
|
-
"infinity": "∞",
|
195
|
-
"minusSign": "-",
|
196
|
-
"nan": "NaN",
|
197
|
-
"percentSign": "%",
|
198
|
-
"perMille": "‰",
|
199
|
-
"plusSign": "+",
|
200
|
-
"timeSeparator": ":"
|
201
|
-
},
|
202
|
-
"decimalFormats-numberSystem-latn": {
|
203
|
-
"standard": "#,##0.###",
|
204
|
-
"short": {
|
205
|
-
"decimalFormat": {
|
206
|
-
"1000-count-one": "0K",
|
207
|
-
"1000-count-other": "0K",
|
208
|
-
"10000-count-one": "00K",
|
209
|
-
"10000-count-other": "00K",
|
210
|
-
"100000-count-one": "000K",
|
211
|
-
"100000-count-other": "000K",
|
212
|
-
"1000000-count-one": "0M",
|
213
|
-
"1000000-count-other": "0M",
|
214
|
-
"10000000-count-one": "00M",
|
215
|
-
"10000000-count-other": "00M",
|
216
|
-
"100000000-count-one": "000M",
|
217
|
-
"100000000-count-other": "000M",
|
218
|
-
"1000000000-count-one": "0B",
|
219
|
-
"1000000000-count-other": "0B",
|
220
|
-
"10000000000-count-one": "00B",
|
221
|
-
"10000000000-count-other": "00B",
|
222
|
-
"100000000000-count-one": "000B",
|
223
|
-
"100000000000-count-other": "000B",
|
224
|
-
"1000000000000-count-one": "0T",
|
225
|
-
"1000000000000-count-other": "0T",
|
226
|
-
"10000000000000-count-one": "00T",
|
227
|
-
"10000000000000-count-other": "00T",
|
228
|
-
"100000000000000-count-one": "000T",
|
229
|
-
"100000000000000-count-other": "000T"
|
230
|
-
}
|
231
|
-
}
|
232
|
-
},
|
233
|
-
"currencyFormats-numberSystem-latn": {
|
234
|
-
"currencySpacing": {
|
235
|
-
"beforeCurrency": {
|
236
|
-
"currencyMatch": "[:^S:]",
|
237
|
-
"surroundingMatch": "[:digit:]",
|
238
|
-
"insertBetween": " "
|
239
|
-
},
|
240
|
-
"afterCurrency": {
|
241
|
-
"currencyMatch": "[:^S:]",
|
242
|
-
"surroundingMatch": "[:digit:]",
|
243
|
-
"insertBetween": " "
|
244
|
-
}
|
245
|
-
},
|
246
|
-
"standard": "¤#,##0.00"
|
247
|
-
}
|
248
|
-
},
|
249
|
-
"units": {
|
250
|
-
"short": {
|
251
|
-
"per": {
|
252
|
-
"compoundUnitPattern": "{0}/{1}"
|
253
|
-
},
|
254
|
-
"speed-mile-per-hour": {
|
255
|
-
"displayName": "miles/hour",
|
256
|
-
"unitPattern-count-one": "{0} mph",
|
257
|
-
"unitPattern-count-other": "{0} mph"
|
258
|
-
}
|
259
|
-
}
|
260
|
-
}
|
261
|
-
}
|
262
|
-
},
|
263
|
-
"supplemental": {
|
264
|
-
"version": {
|
265
|
-
"_cldrVersion": "25",
|
266
|
-
"_number": "$Revision: 91 $"
|
267
|
-
},
|
268
|
-
"currencyData": {
|
269
|
-
"fractions": {
|
270
|
-
"DEFAULT": {
|
271
|
-
"_rounding": "0",
|
272
|
-
"_digits": "2"
|
273
|
-
}
|
274
|
-
}
|
275
|
-
},
|
276
|
-
"likelySubtags": {
|
277
|
-
"en": "en-Latn-US",
|
278
|
-
},
|
279
|
-
"metaZones": {
|
280
|
-
"metazoneInfo": {
|
281
|
-
"timezone": {
|
282
|
-
"America": {
|
283
|
-
"Sao_Paulo": [
|
284
|
-
{
|
285
|
-
"usesMetazone": {
|
286
|
-
"_mzone": "Brasilia"
|
287
|
-
}
|
288
|
-
}
|
289
|
-
]
|
290
|
-
}
|
291
|
-
}
|
292
|
-
}
|
293
|
-
},
|
294
|
-
"plurals-type-cardinal": {
|
295
|
-
"en": {
|
296
|
-
"pluralRule-count-one": "i = 1 and v = 0 @integer 1",
|
297
|
-
"pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
|
298
|
-
}
|
299
|
-
}
|
300
|
-
}
|
301
|
-
});
|
302
|
-
Globalize.loadMessages({
|
303
|
-
"en": {
|
304
|
-
"like": [
|
305
|
-
"{0, plural, offset:1",
|
306
|
-
" =0 {Be the first to like this}",
|
307
|
-
" =1 {You liked this}",
|
308
|
-
" one {You and someone else liked this}",
|
309
|
-
" other {You and # others liked this}",
|
310
|
-
"}"
|
311
|
-
]
|
312
|
-
}
|
313
|
-
});
|
314
|
-
Globalize.loadTimeZone({
|
315
|
-
"zoneData": {
|
316
|
-
"America": {
|
317
|
-
"Sao_Paulo": {
|
318
|
-
"abbrs": [
|
319
|
-
"LMT", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
320
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
321
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
322
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
323
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
324
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
325
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
326
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
327
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
328
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03",
|
329
|
-
"-02", "-03", "-02", "-03", "-02", "-03", "-02", "-03", "-02"
|
330
|
-
],
|
331
|
-
"untils": [
|
332
|
-
-1767214412000, -1206957600000, -1191362400000, -1175374800000, -1159826400000,
|
333
|
-
-633819600000, -622069200000, -602283600000, -591832800000, -570747600000,
|
334
|
-
-560210400000, -539125200000, -531352800000, -195426000000, -184197600000,
|
335
|
-
-155163600000, -150069600000, -128898000000, -121125600000, -99954000000, -89589600000,
|
336
|
-
-68418000000, -57967200000, 499748400000, 511236000000, 530593200000, 540266400000,
|
337
|
-
562129200000, 571197600000, 592974000000, 602042400000, 624423600000, 634701600000,
|
338
|
-
656478000000, 666756000000, 687927600000, 697600800000, 719982000000, 728445600000,
|
339
|
-
750826800000, 761709600000, 782276400000, 793159200000, 813726000000, 824004000000,
|
340
|
-
844570800000, 856058400000, 876106800000, 888717600000, 908074800000, 919562400000,
|
341
|
-
938919600000, 951616800000, 970974000000, 982461600000, 1003028400000, 1013911200000,
|
342
|
-
1036292400000, 1045360800000, 1066532400000, 1076810400000, 1099364400000,
|
343
|
-
1108864800000, 1129431600000, 1140314400000, 1162695600000, 1172368800000,
|
344
|
-
1192330800000, 1203213600000, 1224385200000, 1234663200000, 1255834800000,
|
345
|
-
1266717600000, 1287284400000, 1298167200000, 1318734000000, 1330221600000,
|
346
|
-
1350788400000, 1361066400000, 1382238000000, 1392516000000, 1413687600000,
|
347
|
-
1424570400000, 1445137200000, 1456020000000, 1476586800000, 1487469600000,
|
348
|
-
1508036400000, 1518919200000, 1540090800000, 1550368800000, 1571540400000,
|
349
|
-
1581818400000, 1602990000000, 1613872800000, 1634439600000, 1645322400000,
|
350
|
-
1665889200000, 1677376800000, 1697338800000, 1708221600000, 1729393200000,
|
351
|
-
1739671200000, 1760842800000, 1771725600000, 1792292400000, 1803175200000,
|
352
|
-
1823742000000, 1834624800000, 1855191600000, 1866074400000, 1887246000000,
|
353
|
-
1897524000000, 1918695600000, 1928973600000, 1950145200000, 1960423200000,
|
354
|
-
1981594800000, 1992477600000, 2013044400000, 2024532000000, 2044494000000,
|
355
|
-
2055376800000, 2076548400000, 2086826400000, 2107998000000, 2118880800000,
|
356
|
-
2139447600000, null
|
357
|
-
],
|
358
|
-
"offsets": [
|
359
|
-
186.4667, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180,
|
360
|
-
120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120,
|
361
|
-
180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180,
|
362
|
-
120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120,
|
363
|
-
180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180,
|
364
|
-
120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120,
|
365
|
-
180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120, 180,
|
366
|
-
120, 180, 120, 180, 120, 180, 120, 180, 120, 180, 120
|
367
|
-
],
|
368
|
-
"isdsts": [
|
369
|
-
0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
370
|
-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
|
371
|
-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
|
372
|
-
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
|
373
|
-
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
|
374
|
-
]
|
375
|
-
}
|
376
|
-
}
|
377
|
-
}
|
378
|
-
});
|
379
|
-
|
380
|
-
var en, like, number;
|
381
|
-
|
382
|
-
// Instantiate "en".
|
383
|
-
en = Globalize( "en" );
|
384
|
-
|
385
|
-
// Use Globalize to format dates.
|
386
|
-
document.getElementById( "date" ).textContent = en.formatDate( new Date(), {
|
387
|
-
datetime: "medium"
|
388
|
-
});
|
389
|
-
|
390
|
-
// Use Globalize to format dates on specific time zone.
|
391
|
-
document.getElementById( "zonedDate" ).textContent = en.formatDate( new Date(), {
|
392
|
-
datetime: "full",
|
393
|
-
timeZone: "America/Sao_Paulo"
|
394
|
-
});
|
395
|
-
|
396
|
-
// Use Globalize to format dates to parts.
|
397
|
-
document.getElementById( "dateToParts" ).innerHTML = en.formatDateToParts( new Date(), {
|
398
|
-
datetime: "medium"
|
399
|
-
}).map(function( part ) {
|
400
|
-
switch(part.type) {
|
401
|
-
case "month": return "<strong>" + part.value + "<\/strong>";
|
402
|
-
default: return part.value;
|
403
|
-
}
|
404
|
-
}).reduce(function( memo, value ) {
|
405
|
-
return memo + value;
|
406
|
-
});
|
407
|
-
|
408
|
-
// Use Globalize to format numbers.
|
409
|
-
number = en.numberFormatter();
|
410
|
-
document.getElementById( "number" ).textContent = number( 12345.6789 );
|
411
|
-
document.getElementById( "number-compact" ).textContent = en.formatNumber( 12345.6789, {
|
412
|
-
compact: "short",
|
413
|
-
minimumSignificantDigits: 1,
|
414
|
-
maximumSignificantDigits: 3
|
415
|
-
});
|
416
|
-
|
417
|
-
// Use Globalize to format currencies.
|
418
|
-
document.getElementById( "currency" ).textContent = en.formatCurrency( 69900, "USD" );
|
419
|
-
|
420
|
-
// Use Globalize to get the plural form of a numeric value.
|
421
|
-
document.getElementById( "plural-number" ).textContent = number( 12345.6789 );
|
422
|
-
document.getElementById( "plural-form" ).textContent = en.plural( 12345.6789 );
|
423
|
-
|
424
|
-
// Use Globalize to format a message with plural inflection.
|
425
|
-
like = en.messageFormatter( "like" );
|
426
|
-
document.getElementById( "message-0" ).textContent = like( 0 );
|
427
|
-
document.getElementById( "message-1" ).textContent = like( 1 );
|
428
|
-
document.getElementById( "message-2" ).textContent = like( 2 );
|
429
|
-
document.getElementById( "message-3" ).textContent = like( 3 );
|
430
|
-
|
431
|
-
// Use Globalize to format a relative time.
|
432
|
-
document.getElementById( "relative-time" ).textContent = en.formatRelativeTime( -35, "second" );
|
433
|
-
|
434
|
-
// Use Globalize to format a unit.
|
435
|
-
document.getElementById( "unit" ).textContent = en.formatUnit( 60, "mile/hour", {
|
436
|
-
form: "short"
|
437
|
-
});
|
438
|
-
|
439
|
-
document.getElementById( "requirements" ).style.display = "none";
|
440
|
-
document.getElementById( "demo" ).style.display = "block";
|
441
|
-
|
442
|
-
</script>
|
443
|
-
|
444
|
-
</body>
|
445
|
-
</html>
|