twitter_cldr_js 2.2.0 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/History.txt +8 -0
- data/README.md +11 -1
- data/Rakefile +4 -5
- data/lib/assets/javascripts/twitter_cldr/af.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/ar.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/be.js +211 -101
- data/lib/assets/javascripts/twitter_cldr/bg.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/bn.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/ca.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/cs.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/cy.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/da.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/de.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/el.js +208 -98
- data/lib/assets/javascripts/twitter_cldr/en-GB.js +1994 -0
- data/lib/assets/javascripts/twitter_cldr/en.js +206 -96
- data/lib/assets/javascripts/twitter_cldr/es.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/eu.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/fa.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/fi.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/fil.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/fr.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ga.js +212 -101
- data/lib/assets/javascripts/twitter_cldr/gl.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/he.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/hi.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/hr.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/hu.js +210 -99
- data/lib/assets/javascripts/twitter_cldr/id.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/is.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/it.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ja.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ko.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/lv.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/msa.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/nl.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/no.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/pl.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/pt.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ro.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ru.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/sk.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/sq.js +212 -101
- data/lib/assets/javascripts/twitter_cldr/sr.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/sv.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ta.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/th.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/tr.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/uk.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/ur.js +210 -99
- data/lib/assets/javascripts/twitter_cldr/vi.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/zh-cn.js +209 -98
- data/lib/assets/javascripts/twitter_cldr/zh-tw.js +209 -98
- data/lib/twitter_cldr/js/compiler.rb +24 -5
- data/lib/twitter_cldr/js/mustache/bundle.coffee +6 -0
- data/lib/twitter_cldr/js/mustache/parsers/number_parser.coffee +103 -0
- data/lib/twitter_cldr/js/renderers/base.rb +2 -0
- data/lib/twitter_cldr/js/renderers/parsers/number_parser.rb +34 -0
- data/lib/twitter_cldr/js/renderers.rb +4 -0
- data/lib/twitter_cldr/js/tasks/tasks.rb +15 -3
- data/lib/twitter_cldr/js/version.rb +2 -2
- data/lib/twitter_cldr/js.rb +0 -3
- data/spec/js/parsers/number_parser.spec.js +211 -0
- data/spec/js/utilities.spec.js +0 -3
- data/twitter_cldr_js.gemspec +7 -6
- metadata +25 -47
@@ -1,20 +1,20 @@
|
|
1
|
+
|
1
2
|
/*
|
2
3
|
// Copyright 2012 Twitter, Inc
|
3
4
|
// http://www.apache.org/licenses/LICENSE-2.0
|
4
5
|
|
5
|
-
// TwitterCLDR (JavaScript) v2.2.
|
6
|
+
// TwitterCLDR (JavaScript) v2.2.1
|
6
7
|
// Authors: Cameron Dutro [@camertron]
|
7
8
|
Kirill Lashuk [@KL_7]
|
8
9
|
portions by Sven Fuchs [@svenfuchs]
|
9
10
|
// Homepage: https://twitter.com
|
10
11
|
// Description: Provides date, time, number, and list formatting functionality for various Twitter-supported locales in Javascript.
|
11
|
-
*/
|
12
|
+
*/
|
12
13
|
|
13
14
|
|
14
15
|
/*-module-*/
|
15
16
|
/*_lib/twitter_cldr_*/
|
16
17
|
|
17
|
-
|
18
18
|
(function() {
|
19
19
|
var TwitterCldr, key, obj, root, _ref, _ref1, _ref2, _ref3,
|
20
20
|
__hasProp = {}.hasOwnProperty,
|
@@ -38,7 +38,6 @@
|
|
38
38
|
|
39
39
|
Utilities.char_code_at = function(str, idx) {
|
40
40
|
var code, end, hi, li, low, surrogatePairs;
|
41
|
-
|
42
41
|
str += '';
|
43
42
|
end = str.length;
|
44
43
|
surrogatePairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
@@ -64,7 +63,6 @@
|
|
64
63
|
|
65
64
|
Utilities.unpack_string = function(str) {
|
66
65
|
var code_point, idx, result, _i, _ref;
|
67
|
-
|
68
66
|
result = [];
|
69
67
|
for (idx = _i = 0, _ref = str.length; 0 <= _ref ? _i < _ref : _i > _ref; idx = 0 <= _ref ? ++_i : --_i) {
|
70
68
|
code_point = this.char_code_at(str, idx);
|
@@ -78,10 +76,8 @@
|
|
78
76
|
|
79
77
|
Utilities.pack_array = function(char_arr) {
|
80
78
|
var cur_char;
|
81
|
-
|
82
79
|
return ((function() {
|
83
80
|
var _i, _len, _results;
|
84
|
-
|
85
81
|
_results = [];
|
86
82
|
for (_i = 0, _len = char_arr.length; _i < _len; _i++) {
|
87
83
|
cur_char = char_arr[_i];
|
@@ -93,7 +89,6 @@
|
|
93
89
|
|
94
90
|
Utilities.arraycopy = function(orig, orig_index, dest, dest_index, length) {
|
95
91
|
var count, elem, _i, _len, _ref;
|
96
|
-
|
97
92
|
_ref = orig.slice(orig_index, orig_index + length);
|
98
93
|
for (count = _i = 0, _len = _ref.length; _i < _len; count = ++_i) {
|
99
94
|
elem = _ref[count];
|
@@ -103,7 +98,6 @@
|
|
103
98
|
|
104
99
|
Utilities.max = function(arr) {
|
105
100
|
var elem, i, max, start_index, _i, _j, _len, _ref;
|
106
|
-
|
107
101
|
max = null;
|
108
102
|
for (start_index = _i = 0, _len = arr.length; _i < _len; start_index = ++_i) {
|
109
103
|
elem = arr[start_index];
|
@@ -122,7 +116,6 @@
|
|
122
116
|
|
123
117
|
Utilities.min = function(arr) {
|
124
118
|
var elem, i, min, start_index, _i, _j, _len, _ref;
|
125
|
-
|
126
119
|
min = null;
|
127
120
|
for (start_index = _i = 0, _len = arr.length; _i < _len; start_index = ++_i) {
|
128
121
|
elem = arr[start_index];
|
@@ -162,7 +155,6 @@
|
|
162
155
|
|
163
156
|
PluralRules.rule_for = function(number) {
|
164
157
|
var error;
|
165
|
-
|
166
158
|
try {
|
167
159
|
return this.rules.rule(number);
|
168
160
|
} catch (_error) {
|
@@ -193,7 +185,6 @@
|
|
193
185
|
|
194
186
|
TimespanFormatter.prototype.format = function(seconds, fmt_options) {
|
195
187
|
var key, number, obj, options, strings, token;
|
196
|
-
|
197
188
|
if (fmt_options == null) {
|
198
189
|
fmt_options = {};
|
199
190
|
}
|
@@ -212,7 +203,6 @@
|
|
212
203
|
options["rule"] = TwitterCldr.PluralRules.rule_for(number);
|
213
204
|
strings = (function() {
|
214
205
|
var _i, _len, _ref, _results;
|
215
|
-
|
216
206
|
_ref = this.tokens[options["direction"]][options["unit"]][options["type"]][options["rule"]];
|
217
207
|
_results = [];
|
218
208
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
@@ -226,7 +216,6 @@
|
|
226
216
|
|
227
217
|
TimespanFormatter.prototype.calculate_unit = function(seconds, unit_options) {
|
228
218
|
var key, multiplier, obj, options;
|
229
|
-
|
230
219
|
if (unit_options == null) {
|
231
220
|
unit_options = {};
|
232
221
|
}
|
@@ -266,7 +255,7 @@
|
|
266
255
|
|
267
256
|
TwitterCldr.DateTimeFormatter = (function() {
|
268
257
|
function DateTimeFormatter() {
|
269
|
-
this.tokens = {"date_time":{"default":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"full":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"EEEE","type":"pattern"},{"value":", 'ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd MMMM '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd '","type":"plaintext"},{"value":"tháng","type":"plaintext"},{"value":"' M '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"short":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"additional":{"Ed":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"}],"Gy":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"GyMMM":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"GyMMMEd":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"E","type":"pattern"}],"GyMMMd":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"}],"H":[{"value":"HH","type":"pattern"}],"Hm":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"Hms":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"M":[{"value":"L","type":"pattern"}],"MEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"MMM":[{"value":"LLL","type":"pattern"}],"MMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMdd":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"}],"Md":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"d":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"dd","type":"pattern"}],"h":[{"value":"h","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hm":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hms":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"mmss":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"ms":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"y":[{"value":"'Nă","type":"plaintext"},{"value":"m","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"y","type":"pattern"}],"yM":[{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMM":[{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMM":[{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMd":[{"value":"d","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQ":[{"value":"QQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQQ":[{"value":"QQQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}]}},"time":{"default":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"full":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"short":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"additional":{"Ed":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"}],"Gy":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"GyMMM":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"GyMMMEd":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"E","type":"pattern"}],"GyMMMd":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"}],"H":[{"value":"HH","type":"pattern"}],"Hm":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"Hms":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"M":[{"value":"L","type":"pattern"}],"MEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"MMM":[{"value":"LLL","type":"pattern"}],"MMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMdd":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"}],"Md":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"d":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"dd","type":"pattern"}],"h":[{"value":"h","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hm":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hms":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"mmss":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"ms":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"y":[{"value":"'Nă","type":"plaintext"},{"value":"m","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"y","type":"pattern"}],"yM":[{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMM":[{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMM":[{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMd":[{"value":"d","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQ":[{"value":"QQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQQ":[{"value":"QQQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}]}},"date":{"default":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":", 'ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd MMMM '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd '","type":"plaintext"},{"value":"tháng","type":"plaintext"},{"value":"' M '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"short":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"additional":{"Ed":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"}],"Gy":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"GyMMM":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"GyMMMEd":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"E","type":"pattern"}],"GyMMMd":[{"value":"G","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"}],"H":[{"value":"HH","type":"pattern"}],"Hm":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"Hms":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"M":[{"value":"L","type":"pattern"}],"MEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"MMM":[{"value":"LLL","type":"pattern"}],"MMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMdd":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"}],"Md":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"d":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"dd","type":"pattern"}],"h":[{"value":"h","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hm":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hms":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"mmss":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"ms":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"y":[{"value":"'Nă","type":"plaintext"},{"value":"m","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"y","type":"pattern"}],"yM":[{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMM":[{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMM":[{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMd":[{"value":"d","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQ":[{"value":"QQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQQ":[{"value":"QQQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}]}}};
|
258
|
+
this.tokens = {"date_time":{"default":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"full":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"EEEE","type":"pattern"},{"value":", 'ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd MMMM '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd '","type":"plaintext"},{"value":"tháng","type":"plaintext"},{"value":"' M '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"short":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"additional":{"EHm":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"EHms":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"Ed":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"}],"Ehm":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"Ehms":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"Gy":[{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMMd":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"H":[{"value":"HH","type":"pattern"}],"Hm":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"Hms":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"M":[{"value":"L","type":"pattern"}],"MEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"MMM":[{"value":"LLL","type":"pattern"}],"MMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMdd":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"}],"Md":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"d":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"dd","type":"pattern"}],"h":[{"value":"h","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hm":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hms":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"mmss":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"ms":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"y":[{"value":"'Nă","type":"plaintext"},{"value":"m","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"y","type":"pattern"}],"yM":[{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMM":[{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMM":[{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMd":[{"value":"d","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQ":[{"value":"QQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQQ":[{"value":"QQQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}]}},"time":{"default":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"full":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"zzzz","type":"pattern"}],"long":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"z","type":"pattern"}],"medium":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"short":[{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"additional":{"EHm":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"EHms":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"Ed":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"}],"Ehm":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"Ehms":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"Gy":[{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMMd":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"H":[{"value":"HH","type":"pattern"}],"Hm":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"Hms":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"M":[{"value":"L","type":"pattern"}],"MEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"MMM":[{"value":"LLL","type":"pattern"}],"MMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMdd":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"}],"Md":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"d":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"dd","type":"pattern"}],"h":[{"value":"h","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hm":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hms":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"mmss":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"ms":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"y":[{"value":"'Nă","type":"plaintext"},{"value":"m","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"y","type":"pattern"}],"yM":[{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMM":[{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMM":[{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMd":[{"value":"d","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQ":[{"value":"QQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQQ":[{"value":"QQQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}]}},"date":{"default":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"full":[{"value":"EEEE","type":"pattern"},{"value":", 'ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd MMMM '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"long":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"","type":"plaintext"},{"value":"' dd '","type":"plaintext"},{"value":"tháng","type":"plaintext"},{"value":"' M '","type":"plaintext"},{"value":"năm' ","type":"plaintext"},{"value":"y","type":"pattern"}],"medium":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"short":[{"value":"dd","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"MM","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"additional":{"EHm":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"EHms":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"HH","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"Ed":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"}],"Ehm":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"Ehms":[{"value":"E","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"Gy":[{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"GyMMMd":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"d","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"G","type":"pattern"}],"H":[{"value":"HH","type":"pattern"}],"Hm":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"}],"Hms":[{"value":"H","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"M":[{"value":"L","type":"pattern"}],"MEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"MMM":[{"value":"LLL","type":"pattern"}],"MMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMMM","type":"pattern"}],"MMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"}],"MMdd":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"MM","type":"pattern"}],"Md":[{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"}],"d":[{"value":"'Ngà","type":"plaintext"},{"value":"y","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"dd","type":"pattern"}],"h":[{"value":"h","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hm":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"hms":[{"value":"h","type":"pattern"},{"value":":","type":"plaintext"},{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"a","type":"pattern"}],"mmss":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"ms":[{"value":"mm","type":"pattern"},{"value":":","type":"plaintext"},{"value":"ss","type":"pattern"}],"y":[{"value":"'Nă","type":"plaintext"},{"value":"m","type":"pattern"},{"value":"' ","type":"plaintext"},{"value":"y","type":"pattern"}],"yM":[{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMM":[{"value":"MM","type":"pattern"},{"value":"-","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMM":[{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMEd":[{"value":"E","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMM":[{"value":"MMMM","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMMMd":[{"value":"dd","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"MMM","type":"pattern"},{"value":", ","type":"plaintext"},{"value":"y","type":"pattern"}],"yMd":[{"value":"d","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"M","type":"pattern"},{"value":"/","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQ":[{"value":"QQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}],"yQQQQ":[{"value":"QQQQ","type":"pattern"},{"value":" ","type":"plaintext"},{"value":"y","type":"pattern"}]}}};
|
270
259
|
this.weekday_keys = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
271
260
|
this.methods = {
|
272
261
|
'G': 'era',
|
@@ -300,28 +289,26 @@
|
|
300
289
|
}
|
301
290
|
|
302
291
|
DateTimeFormatter.prototype.format = function(obj, options) {
|
303
|
-
var format_token, token, tokens
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
};
|
292
|
+
var format_token, token, tokens;
|
293
|
+
format_token = (function(_this) {
|
294
|
+
return function(token) {
|
295
|
+
var result;
|
296
|
+
result = "";
|
297
|
+
switch (token.type) {
|
298
|
+
case "pattern":
|
299
|
+
return _this.result_for_token(token, obj);
|
300
|
+
default:
|
301
|
+
if (token.value.length > 0 && token.value[0] === "'" && token.value[token.value.length - 1] === "'") {
|
302
|
+
return token.value.substring(1, token.value.length - 1);
|
303
|
+
} else {
|
304
|
+
return token.value;
|
305
|
+
}
|
306
|
+
}
|
307
|
+
};
|
308
|
+
})(this);
|
321
309
|
tokens = this.get_tokens(obj, options);
|
322
310
|
return ((function() {
|
323
311
|
var _i, _len, _results;
|
324
|
-
|
325
312
|
_results = [];
|
326
313
|
for (_i = 0, _len = tokens.length; _i < _len; _i++) {
|
327
314
|
token = tokens[_i];
|
@@ -333,7 +320,6 @@
|
|
333
320
|
|
334
321
|
DateTimeFormatter.prototype.get_tokens = function(obj, options) {
|
335
322
|
var format, type;
|
336
|
-
|
337
323
|
format = options.format || "date_time";
|
338
324
|
type = options.type || "default";
|
339
325
|
if (format === "additional") {
|
@@ -357,7 +343,6 @@
|
|
357
343
|
|
358
344
|
DateTimeFormatter.prototype.era = function(date, pattern, length) {
|
359
345
|
var choices, index, result;
|
360
|
-
|
361
346
|
switch (length) {
|
362
347
|
case 0:
|
363
348
|
choices = ["", ""];
|
@@ -381,7 +366,6 @@
|
|
381
366
|
|
382
367
|
DateTimeFormatter.prototype.year = function(date, pattern, length) {
|
383
368
|
var year;
|
384
|
-
|
385
369
|
year = date.getFullYear().toString();
|
386
370
|
if (length === 2) {
|
387
371
|
if (year.length !== 1) {
|
@@ -404,7 +388,6 @@
|
|
404
388
|
|
405
389
|
DateTimeFormatter.prototype.quarter = function(date, pattern, length) {
|
406
390
|
var quarter;
|
407
|
-
|
408
391
|
quarter = ((date.getMonth() / 3) | 0) + 1;
|
409
392
|
switch (length) {
|
410
393
|
case 1:
|
@@ -420,7 +403,6 @@
|
|
420
403
|
|
421
404
|
DateTimeFormatter.prototype.quarter_stand_alone = function(date, pattern, length) {
|
422
405
|
var quarter;
|
423
|
-
|
424
406
|
quarter = (date.getMonth() - 1) / 3 + 1;
|
425
407
|
switch (length) {
|
426
408
|
case 1:
|
@@ -440,7 +422,6 @@
|
|
440
422
|
|
441
423
|
DateTimeFormatter.prototype.month = function(date, pattern, length) {
|
442
424
|
var month_str;
|
443
|
-
|
444
425
|
month_str = (date.getMonth() + 1).toString();
|
445
426
|
switch (length) {
|
446
427
|
case 1:
|
@@ -461,7 +442,6 @@
|
|
461
442
|
|
462
443
|
DateTimeFormatter.prototype.month_stand_alone = function(date, pattern, length) {
|
463
444
|
var month_str;
|
464
|
-
|
465
445
|
month_str = (date.getMonth() + 1).toString();
|
466
446
|
switch (length) {
|
467
447
|
case 1:
|
@@ -490,7 +470,6 @@
|
|
490
470
|
|
491
471
|
DateTimeFormatter.prototype.weekday = function(date, pattern, length) {
|
492
472
|
var key;
|
493
|
-
|
494
473
|
key = this.weekday_keys[date.getDay()];
|
495
474
|
switch (length) {
|
496
475
|
case 1:
|
@@ -506,7 +485,6 @@
|
|
506
485
|
|
507
486
|
DateTimeFormatter.prototype.weekday_local = function(date, pattern, length) {
|
508
487
|
var day;
|
509
|
-
|
510
488
|
switch (length) {
|
511
489
|
case 1:
|
512
490
|
case 2:
|
@@ -541,7 +519,6 @@
|
|
541
519
|
|
542
520
|
DateTimeFormatter.prototype.hour = function(time, pattern, length) {
|
543
521
|
var hour;
|
544
|
-
|
545
522
|
hour = time.getHours();
|
546
523
|
switch (pattern[0]) {
|
547
524
|
case 'h':
|
@@ -593,7 +570,6 @@
|
|
593
570
|
|
594
571
|
DateTimeFormatter.prototype.timezone = function(time, pattern, length) {
|
595
572
|
var hours, minutes, offset, offsetString, sign;
|
596
|
-
|
597
573
|
offset = time.getTimezoneOffset();
|
598
574
|
hours = ("00" + (Math.abs(offset) / 60).toString()).slice(-2);
|
599
575
|
minutes = ("00" + (Math.abs(offset) % 60).toString()).slice(-2);
|
@@ -624,7 +600,6 @@
|
|
624
600
|
|
625
601
|
AdditionalDateFormatSelector.prototype.find_closest = function(goal_pattern) {
|
626
602
|
var key, min_key, min_rank, rank, ranks;
|
627
|
-
|
628
603
|
if ((goal_pattern == null) || goal_pattern.trim().length === 0) {
|
629
604
|
return null;
|
630
605
|
} else {
|
@@ -644,7 +619,6 @@
|
|
644
619
|
|
645
620
|
AdditionalDateFormatSelector.prototype.patterns = function() {
|
646
621
|
var key, _results;
|
647
|
-
|
648
622
|
_results = [];
|
649
623
|
for (key in this.pattern_hash) {
|
650
624
|
_results.push(key);
|
@@ -654,7 +628,6 @@
|
|
654
628
|
|
655
629
|
AdditionalDateFormatSelector.prototype.separate = function(pattern_key) {
|
656
630
|
var cur_char, last_char, result, _i, _len;
|
657
|
-
|
658
631
|
last_char = "";
|
659
632
|
result = [];
|
660
633
|
for (_i = 0, _len = pattern_key.length; _i < _len; _i++) {
|
@@ -671,7 +644,6 @@
|
|
671
644
|
|
672
645
|
AdditionalDateFormatSelector.prototype.all_separated_patterns = function() {
|
673
646
|
var key, _results;
|
674
|
-
|
675
647
|
_results = [];
|
676
648
|
for (key in this.pattern_hash) {
|
677
649
|
_results.push(this.separate(key));
|
@@ -681,7 +653,6 @@
|
|
681
653
|
|
682
654
|
AdditionalDateFormatSelector.prototype.score = function(entities, goal_entities) {
|
683
655
|
var score;
|
684
|
-
|
685
656
|
score = this.exist_score(entities, goal_entities) * 2;
|
686
657
|
score += this.position_score(entities, goal_entities);
|
687
658
|
return score + this.count_score(entities, goal_entities);
|
@@ -689,7 +660,6 @@
|
|
689
660
|
|
690
661
|
AdditionalDateFormatSelector.prototype.position_score = function(entities, goal_entities) {
|
691
662
|
var found, goal_entity, index, sum;
|
692
|
-
|
693
663
|
sum = 0;
|
694
664
|
for (index in goal_entities) {
|
695
665
|
goal_entity = goal_entities[index];
|
@@ -703,13 +673,11 @@
|
|
703
673
|
|
704
674
|
AdditionalDateFormatSelector.prototype.exist_score = function(entities, goal_entities) {
|
705
675
|
var count, entity, goal_entity, _i, _len;
|
706
|
-
|
707
676
|
count = 0;
|
708
677
|
for (_i = 0, _len = goal_entities.length; _i < _len; _i++) {
|
709
678
|
goal_entity = goal_entities[_i];
|
710
679
|
if (!(((function() {
|
711
680
|
var _j, _len1, _results;
|
712
|
-
|
713
681
|
_results = [];
|
714
682
|
for (_j = 0, _len1 = entities.length; _j < _len1; _j++) {
|
715
683
|
entity = entities[_j];
|
@@ -727,13 +695,11 @@
|
|
727
695
|
|
728
696
|
AdditionalDateFormatSelector.prototype.count_score = function(entities, goal_entities) {
|
729
697
|
var entity, found_entity, goal_entity, sum, _i, _len;
|
730
|
-
|
731
698
|
sum = 0;
|
732
699
|
for (_i = 0, _len = goal_entities.length; _i < _len; _i++) {
|
733
700
|
goal_entity = goal_entities[_i];
|
734
701
|
found_entity = ((function() {
|
735
702
|
var _j, _len1, _results;
|
736
|
-
|
737
703
|
_results = [];
|
738
704
|
for (_j = 0, _len1 = entities.length; _j < _len1; _j++) {
|
739
705
|
entity = entities[_j];
|
@@ -752,7 +718,6 @@
|
|
752
718
|
|
753
719
|
AdditionalDateFormatSelector.prototype.rank = function(goal_pattern) {
|
754
720
|
var result, separated_goal_pattern, separated_pattern, _i, _len, _ref;
|
755
|
-
|
756
721
|
separated_goal_pattern = this.separate(goal_pattern);
|
757
722
|
result = {};
|
758
723
|
_ref = this.all_separated_patterns();
|
@@ -782,7 +747,6 @@
|
|
782
747
|
|
783
748
|
NumberFormatter.prototype.format = function(number, options) {
|
784
749
|
var fraction, fraction_format, integer_format, intg, key, opts, prefix, result, sign, suffix, val, _ref, _ref1;
|
785
|
-
|
786
750
|
if (options == null) {
|
787
751
|
options = {};
|
788
752
|
}
|
@@ -812,7 +776,6 @@
|
|
812
776
|
|
813
777
|
NumberFormatter.prototype.parse_number = function(number, options) {
|
814
778
|
var precision;
|
815
|
-
|
816
779
|
if (options == null) {
|
817
780
|
options = {};
|
818
781
|
}
|
@@ -827,7 +790,6 @@
|
|
827
790
|
|
828
791
|
NumberFormatter.prototype.precision_from = function(num) {
|
829
792
|
var parts;
|
830
|
-
|
831
793
|
parts = num.toString().split(".");
|
832
794
|
if (parts.length === 2) {
|
833
795
|
return parts[1].length;
|
@@ -838,7 +800,6 @@
|
|
838
800
|
|
839
801
|
NumberFormatter.prototype.round_to = function(number, precision) {
|
840
802
|
var factor;
|
841
|
-
|
842
803
|
factor = Math.pow(10, precision);
|
843
804
|
return Math.round(number * factor) / factor;
|
844
805
|
};
|
@@ -897,7 +858,6 @@
|
|
897
858
|
|
898
859
|
DecimalFormatter.prototype.format = function(number, options) {
|
899
860
|
var error;
|
900
|
-
|
901
861
|
if (options == null) {
|
902
862
|
options = {};
|
903
863
|
}
|
@@ -944,7 +904,6 @@
|
|
944
904
|
|
945
905
|
CurrencyFormatter.prototype.format = function(number, options) {
|
946
906
|
var currency, symbol;
|
947
|
-
|
948
907
|
if (options == null) {
|
949
908
|
options = {};
|
950
909
|
}
|
@@ -970,7 +929,6 @@
|
|
970
929
|
|
971
930
|
CurrencyFormatter.prototype.default_format_options_for = function(number) {
|
972
931
|
var precision;
|
973
|
-
|
974
932
|
precision = this.precision_from(number);
|
975
933
|
if (precision === 0) {
|
976
934
|
precision = this.default_precision;
|
@@ -1019,10 +977,8 @@
|
|
1019
977
|
|
1020
978
|
AbbreviatedNumberFormatter.prototype.get_key = function(number) {
|
1021
979
|
var i, zeroes;
|
1022
|
-
|
1023
980
|
zeroes = ((function() {
|
1024
981
|
var _i, _ref2, _results;
|
1025
|
-
|
1026
982
|
_results = [];
|
1027
983
|
for (i = _i = 0, _ref2 = Math.floor(number).toString().length - 1; 0 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 0 <= _ref2 ? ++_i : --_i) {
|
1028
984
|
_results.push("0");
|
@@ -1034,7 +990,6 @@
|
|
1034
990
|
|
1035
991
|
AbbreviatedNumberFormatter.prototype.get_tokens = function(number, options) {
|
1036
992
|
var format, tokens, type;
|
1037
|
-
|
1038
993
|
if (options == null) {
|
1039
994
|
options = {};
|
1040
995
|
}
|
@@ -1050,7 +1005,6 @@
|
|
1050
1005
|
|
1051
1006
|
AbbreviatedNumberFormatter.prototype.transform_number = function(number) {
|
1052
1007
|
var factor, power;
|
1053
|
-
|
1054
1008
|
if ((number < this.NUMBER_MAX) && (number >= this.NUMBER_MIN)) {
|
1055
1009
|
power = Math.floor((number.toString().length - 1) / 3) * 3;
|
1056
1010
|
factor = Math.pow(10, power);
|
@@ -1101,7 +1055,6 @@
|
|
1101
1055
|
|
1102
1056
|
BaseHelper.prototype.interpolate = function(string, value, orientation) {
|
1103
1057
|
var i, length, start;
|
1104
|
-
|
1105
1058
|
if (orientation == null) {
|
1106
1059
|
orientation = "right";
|
1107
1060
|
}
|
@@ -1111,7 +1064,6 @@
|
|
1111
1064
|
if (string.length < length) {
|
1112
1065
|
string = (((function() {
|
1113
1066
|
var _i, _results;
|
1114
|
-
|
1115
1067
|
_results = [];
|
1116
1068
|
for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) {
|
1117
1069
|
_results.push("#");
|
@@ -1136,7 +1088,6 @@
|
|
1136
1088
|
|
1137
1089
|
function IntegerHelper(token, symbols) {
|
1138
1090
|
var format;
|
1139
|
-
|
1140
1091
|
if (symbols == null) {
|
1141
1092
|
symbols = {};
|
1142
1093
|
}
|
@@ -1155,7 +1106,6 @@
|
|
1155
1106
|
|
1156
1107
|
IntegerHelper.prototype.format_groups = function(string) {
|
1157
1108
|
var cur_token, token, tokens;
|
1158
|
-
|
1159
1109
|
if (this.groups.length === 0) {
|
1160
1110
|
return string;
|
1161
1111
|
}
|
@@ -1175,7 +1125,6 @@
|
|
1175
1125
|
tokens.push(string);
|
1176
1126
|
return ((function() {
|
1177
1127
|
var _i, _len, _results;
|
1178
|
-
|
1179
1128
|
_results = [];
|
1180
1129
|
for (_i = 0, _len = tokens.length; _i < _len; _i++) {
|
1181
1130
|
token = tokens[_i];
|
@@ -1189,7 +1138,6 @@
|
|
1189
1138
|
|
1190
1139
|
IntegerHelper.prototype.parse_groups = function(format) {
|
1191
1140
|
var index, rest, width, widths;
|
1192
|
-
|
1193
1141
|
index = format.lastIndexOf(',');
|
1194
1142
|
if (!(index > 0)) {
|
1195
1143
|
return [];
|
@@ -1201,7 +1149,6 @@
|
|
1201
1149
|
}
|
1202
1150
|
widths = (function() {
|
1203
1151
|
var _i, _len, _results;
|
1204
|
-
|
1205
1152
|
_results = [];
|
1206
1153
|
for (_i = 0, _len = widths.length; _i < _len; _i++) {
|
1207
1154
|
width = widths[_i];
|
@@ -1214,7 +1161,6 @@
|
|
1214
1161
|
widths.reverse();
|
1215
1162
|
return ((function() {
|
1216
1163
|
var _i, _ref4, _results;
|
1217
|
-
|
1218
1164
|
_results = [];
|
1219
1165
|
for (index = _i = 0, _ref4 = widths.length; 0 <= _ref4 ? _i < _ref4 : _i > _ref4; index = 0 <= _ref4 ? ++_i : --_i) {
|
1220
1166
|
if (widths.indexOf(widths[index], index + 1) === -1) {
|
@@ -1255,7 +1201,6 @@
|
|
1255
1201
|
|
1256
1202
|
FractionHelper.prototype.apply = function(fraction, options) {
|
1257
1203
|
var precision;
|
1258
|
-
|
1259
1204
|
if (options == null) {
|
1260
1205
|
options = {};
|
1261
1206
|
}
|
@@ -1269,12 +1214,10 @@
|
|
1269
1214
|
|
1270
1215
|
FractionHelper.prototype.format_for = function(options) {
|
1271
1216
|
var i, precision;
|
1272
|
-
|
1273
1217
|
precision = options.precision != null ? options.precision : this.precision;
|
1274
1218
|
if (precision) {
|
1275
1219
|
return ((function() {
|
1276
1220
|
var _i, _results;
|
1277
|
-
|
1278
1221
|
_results = [];
|
1279
1222
|
for (i = _i = 0; 0 <= precision ? _i < precision : _i > precision; i = 0 <= precision ? ++_i : --_i) {
|
1280
1223
|
_results.push("0");
|
@@ -1297,10 +1240,8 @@
|
|
1297
1240
|
|
1298
1241
|
Currencies.currency_codes = function() {
|
1299
1242
|
var data, _;
|
1300
|
-
|
1301
1243
|
return this.codes || (this.codes = (function() {
|
1302
1244
|
var _ref4, _results;
|
1303
|
-
|
1304
1245
|
_ref4 = this.currencies;
|
1305
1246
|
_results = [];
|
1306
1247
|
for (_ in _ref4) {
|
@@ -1313,7 +1254,6 @@
|
|
1313
1254
|
|
1314
1255
|
Currencies.for_code = function(currency_code) {
|
1315
1256
|
var country_name, data, result, _ref4;
|
1316
|
-
|
1317
1257
|
result = null;
|
1318
1258
|
_ref4 = this.currencies;
|
1319
1259
|
for (country_name in _ref4) {
|
@@ -1353,7 +1293,6 @@
|
|
1353
1293
|
|
1354
1294
|
ListFormatter.prototype.compose_list = function(list) {
|
1355
1295
|
var format_key, i, result, _i, _ref4;
|
1356
|
-
|
1357
1296
|
result = this.compose(this.formats.end || this.formats.middle || "", [list[list.length - 2], list[list.length - 1]]);
|
1358
1297
|
if (list.length > 2) {
|
1359
1298
|
for (i = _i = 3, _ref4 = list.length; 3 <= _ref4 ? _i <= _ref4 : _i >= _ref4; i = 3 <= _ref4 ? ++_i : --_i) {
|
@@ -1369,10 +1308,8 @@
|
|
1369
1308
|
|
1370
1309
|
ListFormatter.prototype.compose = function(format, elements) {
|
1371
1310
|
var element, result;
|
1372
|
-
|
1373
1311
|
elements = (function() {
|
1374
1312
|
var _i, _len, _results;
|
1375
|
-
|
1376
1313
|
_results = [];
|
1377
1314
|
for (_i = 0, _len = elements.length; _i < _len; _i++) {
|
1378
1315
|
element = elements[_i];
|
@@ -1425,7 +1362,6 @@
|
|
1425
1362
|
|
1426
1363
|
Bidi.bidi_class_for = function(code_point) {
|
1427
1364
|
var bidi_class, end, range, range_list, range_offset, ranges, start, _i, _len, _ref4;
|
1428
|
-
|
1429
1365
|
_ref4 = this.bidi_classes;
|
1430
1366
|
for (bidi_class in _ref4) {
|
1431
1367
|
ranges = _ref4[bidi_class];
|
@@ -1446,7 +1382,6 @@
|
|
1446
1382
|
|
1447
1383
|
Bidi.from_string = function(str, options) {
|
1448
1384
|
var string_arr;
|
1449
|
-
|
1450
1385
|
if (options == null) {
|
1451
1386
|
options = {};
|
1452
1387
|
}
|
@@ -1466,7 +1401,6 @@
|
|
1466
1401
|
|
1467
1402
|
Bidi.compute_types = function(arr) {
|
1468
1403
|
var code_point, _i, _len, _results;
|
1469
|
-
|
1470
1404
|
_results = [];
|
1471
1405
|
for (_i = 0, _len = arr.length; _i < _len; _i++) {
|
1472
1406
|
code_point = arr[_i];
|
@@ -1481,7 +1415,6 @@
|
|
1481
1415
|
|
1482
1416
|
Bidi.prototype.reorder_visually = function() {
|
1483
1417
|
var depth, finish, i, level, lowest_odd, max, start, tmpb, tmpo, _i, _j, _k, _len, _ref4, _ref5;
|
1484
|
-
|
1485
1418
|
if (!this.string_arr) {
|
1486
1419
|
throw "No string given!";
|
1487
1420
|
}
|
@@ -1524,7 +1457,6 @@
|
|
1524
1457
|
|
1525
1458
|
Bidi.prototype.compute_paragraph_embedding_level = function() {
|
1526
1459
|
var type, _i, _len, _ref4;
|
1527
|
-
|
1528
1460
|
if (["LTR", "RTL"].indexOf(this.direction) > -1) {
|
1529
1461
|
if (this.direction === "LTR") {
|
1530
1462
|
return 0;
|
@@ -1552,7 +1484,6 @@
|
|
1552
1484
|
|
1553
1485
|
Bidi.prototype.compute_explicit_levels = function() {
|
1554
1486
|
var current_embedding, directional_override, embedding_stack, i, input, is_ltr, is_special, len, new_embedding, next_fmt, output, size, sp, _i, _j, _ref4, _ref5;
|
1555
|
-
|
1556
1487
|
current_embedding = this.base_embedding;
|
1557
1488
|
directional_override = -1;
|
1558
1489
|
embedding_stack = [];
|
@@ -1614,7 +1545,6 @@
|
|
1614
1545
|
|
1615
1546
|
Bidi.prototype.compute_runs = function() {
|
1616
1547
|
var current_embedding, i, last_run_start, run_count, where, _i, _j, _ref4, _ref5;
|
1617
|
-
|
1618
1548
|
run_count = 0;
|
1619
1549
|
current_embedding = this.base_embedding;
|
1620
1550
|
for (i = _i = 0, _ref4 = this.length; 0 <= _ref4 ? _i < _ref4 : _i > _ref4; i = 0 <= _ref4 ? ++_i : --_i) {
|
@@ -1639,7 +1569,6 @@
|
|
1639
1569
|
|
1640
1570
|
Bidi.prototype.resolve_weak_types = function() {
|
1641
1571
|
var eor, finish, i, j, k, level, next_level, next_type, prev_strong_type, prev_type, previous_level, run_count, run_idx, sor, start, _i, _j, _k;
|
1642
|
-
|
1643
1572
|
run_count = this.runs.length;
|
1644
1573
|
previous_level = this.base_embedding;
|
1645
1574
|
for (run_idx = _i = 0; 0 <= run_count ? _i < run_count : _i > run_count; run_idx = 0 <= run_count ? ++_i : --_i) {
|
@@ -1723,7 +1652,6 @@
|
|
1723
1652
|
|
1724
1653
|
Bidi.prototype.resolve_implicit_levels = function() {
|
1725
1654
|
var i, _i, _ref4;
|
1726
|
-
|
1727
1655
|
for (i = _i = 0, _ref4 = this.length; 0 <= _ref4 ? _i < _ref4 : _i > _ref4; i = 0 <= _ref4 ? ++_i : --_i) {
|
1728
1656
|
if ((this.levels[i] & 1) === 0) {
|
1729
1657
|
if (this.types[i] === "R") {
|
@@ -1741,7 +1669,6 @@
|
|
1741
1669
|
|
1742
1670
|
Bidi.prototype.resolve_neutral_types = function() {
|
1743
1671
|
var embedding_direction, eor, finish, i, j, level, neutral_start, new_strong, next_level, override, prev_strong, previous_level, run, run_count, sor, start, this_type, _i, _j, _k;
|
1744
|
-
|
1745
1672
|
run_count = this.get_run_count();
|
1746
1673
|
previous_level = this.base_embedding;
|
1747
1674
|
for (run = _i = 0; 0 <= run_count ? _i < run_count : _i > run_count; run = 0 <= run_count ? ++_i : --_i) {
|
@@ -1795,7 +1722,6 @@
|
|
1795
1722
|
|
1796
1723
|
Bidi.prototype.reinsert_formatting_codes = function() {
|
1797
1724
|
var index, input, left_level, len, next_fmt, output, right_level, _i, _ref4;
|
1798
|
-
|
1799
1725
|
if ((this.formatter_indices != null) && this.formatter_indices.length > 0) {
|
1800
1726
|
input = this.length;
|
1801
1727
|
output = this.levels.length;
|
@@ -1833,11 +1759,10 @@
|
|
1833
1759
|
TwitterCldr.Calendar = (function() {
|
1834
1760
|
function Calendar() {}
|
1835
1761
|
|
1836
|
-
Calendar.calendar = {"additional_formats":{"Ed":"E, dd","Gy":"G
|
1762
|
+
Calendar.calendar = {"additional_formats":{"EHm":"E HH:mm","EHms":"E HH:mm:ss","Ed":"E, dd","Ehm":"E h:mm a","Ehms":"E h:mm:ss a","Gy":"y G","GyMMM":"MMM y G","GyMMMEd":"E, MMM d, y G","GyMMMd":"MMM d, y G","H":"HH","Hm":"H:mm","Hms":"H:mm:ss","M":"L","MEd":"E, dd-M","MMM":"LLL","MMMEd":"E, dd MMM","MMMMEd":"E, dd MMMM","MMMMd":"dd MMMM","MMMd":"dd MMM","MMdd":"dd-MM","Md":"dd-M","d":"'Ngày' dd","h":"h a","hm":"h:mm a","hms":"h:mm:ss a","mmss":"mm:ss","ms":"mm:ss","y":"'Năm' y","yM":"M/y","yMEd":"E, dd-M-y","yMM":"MM-y","yMMM":"MMM y","yMMMEd":"E, dd MMM y","yMMMM":"MMMM y","yMMMd":"dd MMM, y","yMd":"d/M/y","yQQQ":"QQQ y","yQQQQ":"QQQQ y"},"days":{"format":{"abbreviated":{"fri":"Th 6","mon":"Th 2","sat":"Th 7","sun":"CN","thu":"Th 5","tue":"Th 3","wed":"Th 4"},"narrow":{"fri":"T6","mon":"T2","sat":"T7","sun":"CN","thu":"T5","tue":"T3","wed":"T4"},"short":{"fri":"T6","mon":"T2","sat":"T7","sun":"CN","thu":"T5","tue":"T3","wed":"T4"},"wide":{"fri":"Thứ sáu","mon":"Thứ hai","sat":"Thứ bảy","sun":"Chủ nhật","thu":"Thứ năm","tue":"Thứ ba","wed":"Thứ tư"}},"stand-alone":{"abbreviated":{"fri":"Th 6","mon":"Th 2","sat":"Th 7","sun":"CN","thu":"Th 5","tue":"Th 3","wed":"Th 4"},"narrow":{"fri":"T6","mon":"T2","sat":"T7","sun":"CN","thu":"T5","tue":"T3","wed":"T4"},"short":{"fri":"T6","mon":"T2","sat":"T7","sun":"CN","thu":"T5","tue":"T3","wed":"T4"},"wide":{"fri":"Thứ sáu","mon":"Thứ hai","sat":"Thứ bảy","sun":"Chủ nhật","thu":"Thứ năm","tue":"Thứ ba","wed":"Thứ tư"}}},"eras":{"abbr":{"0":"tr. CN","1":"sau CN"},"name":{"0":"Before Christ","1":"Anno Domini"},"narrow":{"0":"B","1":"A"}},"fields":{"day":"Ngày","dayperiod":"SA/CH","era":"Thời đại","hour":"Giờ","minute":"Phút","month":"Tháng","second":"Giây","week":"Tuần","weekday":"Ngày trong tuần","year":"Năm","zone":"Múi giờ"},"formats":{"date":{"full":{"pattern":"EEEE, 'ngày' dd MMMM 'năm' y"},"long":{"pattern":"'Ngày' dd 'tháng' M 'năm' y"},"medium":{"pattern":"dd-MM-y"},"short":{"pattern":"dd/MM/y"}},"datetime":{"full":{"pattern":"{{time}} {{date}}"},"long":{"pattern":"{{time}} {{date}}"},"medium":{"pattern":"{{time}} {{date}}"},"short":{"pattern":"{{time}} {{date}}"}},"time":{"full":{"pattern":"HH:mm:ss zzzz"},"long":{"pattern":"HH:mm:ss z"},"medium":{"pattern":"HH:mm:ss"},"short":{"pattern":"HH:mm"}}},"months":{"format":{"abbreviated":{"1":"thg 1","10":"thg 10","11":"thg 11","12":"thg 12","2":"thg 2","3":"thg 3","4":"thg 4","5":"thg 5","6":"thg 6","7":"thg 7","8":"thg 8","9":"thg 9"},"narrow":{"1":1,"10":10,"11":11,"12":12,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9},"wide":{"1":"tháng một","10":"tháng mười","11":"tháng mười một","12":"tháng mười hai","2":"tháng hai","3":"tháng ba","4":"tháng tư","5":"tháng năm","6":"tháng sáu","7":"tháng bảy","8":"tháng tám","9":"tháng chín"}},"stand-alone":{"abbreviated":{"1":"thg 1","10":"thg 10","11":"thg 11","12":"thg 12","2":"thg 2","3":"thg 3","4":"thg 4","5":"thg 5","6":"thg 6","7":"thg 7","8":"thg 8","9":"thg 9"},"narrow":{"1":1,"10":10,"11":11,"12":12,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9},"wide":{"1":"tháng một","10":"tháng mười","11":"tháng mười một","12":"tháng mười hai","2":"tháng hai","3":"tháng ba","4":"tháng tư","5":"tháng năm","6":"tháng sáu","7":"tháng bảy","8":"tháng tám","9":"tháng chín"}}},"periods":{"format":{"abbreviated":null,"narrow":{"am":"a","noon":"n","pm":"p"},"wide":{"am":"SA","noon":"noon","pm":"CH","variant":{"am":"a.m.","pm":"p.m."}}},"stand-alone":{}},"quarters":{"format":{"abbreviated":{"1":"Q1","2":"Q2","3":"Q3","4":"Q4"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"Quý 1","2":"Quý 2","3":"Quý 3","4":"Quý 4"}},"stand-alone":{"abbreviated":{"1":"Q1","2":"Q2","3":"Q3","4":"Q4"},"narrow":{"1":1,"2":2,"3":3,"4":4},"wide":{"1":"Quý 1","2":"Quý 2","3":"Quý 3","4":"Quý 4"}}}};
|
1837
1763
|
|
1838
1764
|
Calendar.months = function(options) {
|
1839
1765
|
var key, result, root, val;
|
1840
|
-
|
1841
1766
|
if (options == null) {
|
1842
1767
|
options = {};
|
1843
1768
|
}
|
@@ -1859,7 +1784,6 @@
|
|
1859
1784
|
|
1860
1785
|
Calendar.get_root = function(key, options) {
|
1861
1786
|
var format, names_form, root, _ref4;
|
1862
|
-
|
1863
1787
|
if (options == null) {
|
1864
1788
|
options = {};
|
1865
1789
|
}
|
@@ -1873,6 +1797,193 @@
|
|
1873
1797
|
|
1874
1798
|
})();
|
1875
1799
|
|
1800
|
+
TwitterCldr = {};
|
1801
|
+
|
1802
|
+
TwitterCldr.NumberParser = (function() {
|
1803
|
+
function NumberParser() {
|
1804
|
+
this.group_separator = "\\\.";
|
1805
|
+
this.decimal_separator = ",";
|
1806
|
+
this.separator_chars = ['\\.', ',', '\\s'].join("");
|
1807
|
+
}
|
1808
|
+
|
1809
|
+
NumberParser.prototype.parse = function(number_text, options) {
|
1810
|
+
var num, num_list, punct_list, result, separators, token, tokens, _i, _len;
|
1811
|
+
if (options == null) {
|
1812
|
+
options = {};
|
1813
|
+
}
|
1814
|
+
if (options.strict === void 0) {
|
1815
|
+
options.strict = true;
|
1816
|
+
}
|
1817
|
+
separators = this.get_separators(options.strict);
|
1818
|
+
tokens = this.tokenize(number_text, separators.group, separators.decimal);
|
1819
|
+
num_list = [];
|
1820
|
+
punct_list = [];
|
1821
|
+
for (_i = 0, _len = tokens.length; _i < _len; _i++) {
|
1822
|
+
token = tokens[_i];
|
1823
|
+
if (token.type === "numeric") {
|
1824
|
+
num_list.push(token);
|
1825
|
+
} else {
|
1826
|
+
punct_list.push(token);
|
1827
|
+
}
|
1828
|
+
}
|
1829
|
+
if (!this.is_punct_valid(punct_list)) {
|
1830
|
+
throw "Invalid number";
|
1831
|
+
}
|
1832
|
+
if (!(tokens.slice(-1)[0] && tokens.slice(-1)[0]["type"] === "numeric")) {
|
1833
|
+
throw "Invalid number";
|
1834
|
+
}
|
1835
|
+
if (punct_list.slice(-1)[0] && punct_list.slice(-1)[0]["type"] === "decimal") {
|
1836
|
+
result = parseInt(((function() {
|
1837
|
+
var _j, _len1, _ref4, _results;
|
1838
|
+
_ref4 = num_list.slice(0, -1);
|
1839
|
+
_results = [];
|
1840
|
+
for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
|
1841
|
+
num = _ref4[_j];
|
1842
|
+
_results.push(num.value);
|
1843
|
+
}
|
1844
|
+
return _results;
|
1845
|
+
})()).join(""));
|
1846
|
+
return result + parseInt(num_list.slice(-1)[0].value) / Math.pow(10.0, num_list.slice(-1)[0].value.length);
|
1847
|
+
} else {
|
1848
|
+
return parseInt(((function() {
|
1849
|
+
var _j, _len1, _results;
|
1850
|
+
_results = [];
|
1851
|
+
for (_j = 0, _len1 = num_list.length; _j < _len1; _j++) {
|
1852
|
+
num = num_list[_j];
|
1853
|
+
_results.push(num.value);
|
1854
|
+
}
|
1855
|
+
return _results;
|
1856
|
+
})()).join(""));
|
1857
|
+
}
|
1858
|
+
};
|
1859
|
+
|
1860
|
+
NumberParser.prototype.try_parse = function(number_text, default_value, callback, options) {
|
1861
|
+
var err, result;
|
1862
|
+
if (default_value == null) {
|
1863
|
+
default_value = null;
|
1864
|
+
}
|
1865
|
+
if (callback == null) {
|
1866
|
+
callback = null;
|
1867
|
+
}
|
1868
|
+
if (options == null) {
|
1869
|
+
options = {};
|
1870
|
+
}
|
1871
|
+
result = (function() {
|
1872
|
+
try {
|
1873
|
+
return this.parse(number_text, options);
|
1874
|
+
} catch (_error) {
|
1875
|
+
err = _error;
|
1876
|
+
if (err.toString() === "Invalid number") {
|
1877
|
+
return null;
|
1878
|
+
} else {
|
1879
|
+
throw err;
|
1880
|
+
}
|
1881
|
+
}
|
1882
|
+
}).call(this);
|
1883
|
+
if (callback) {
|
1884
|
+
return callback(result);
|
1885
|
+
} else {
|
1886
|
+
return result || default_value;
|
1887
|
+
}
|
1888
|
+
};
|
1889
|
+
|
1890
|
+
NumberParser.prototype.is_valid = function(number_text, options) {
|
1891
|
+
var err;
|
1892
|
+
if (options == null) {
|
1893
|
+
options = {};
|
1894
|
+
}
|
1895
|
+
try {
|
1896
|
+
this.parse(number_text, options);
|
1897
|
+
return true;
|
1898
|
+
} catch (_error) {
|
1899
|
+
err = _error;
|
1900
|
+
if (err.toString() === "Invalid number") {
|
1901
|
+
return false;
|
1902
|
+
} else {
|
1903
|
+
throw err;
|
1904
|
+
}
|
1905
|
+
}
|
1906
|
+
};
|
1907
|
+
|
1908
|
+
NumberParser.is_numeric = function(text, separators) {
|
1909
|
+
var regexp;
|
1910
|
+
if (separators == null) {
|
1911
|
+
separators = new NumberParser().separator_chars;
|
1912
|
+
}
|
1913
|
+
regexp = new RegExp("^[0-9" + separators + "]+$");
|
1914
|
+
return regexp.test(text);
|
1915
|
+
};
|
1916
|
+
|
1917
|
+
NumberParser.prototype.is_punct_valid = function(punct_list) {
|
1918
|
+
var index, punct, valid, _i, _len;
|
1919
|
+
valid = true;
|
1920
|
+
for (index = _i = 0, _len = punct_list.length; _i < _len; index = ++_i) {
|
1921
|
+
punct = punct_list[index];
|
1922
|
+
valid = valid && (punct.type === "group" || (index === (punct_list.length - 1) && punct.type === "decimal"));
|
1923
|
+
}
|
1924
|
+
return valid;
|
1925
|
+
};
|
1926
|
+
|
1927
|
+
NumberParser.prototype.get_separators = function(strict) {
|
1928
|
+
var decimal, group;
|
1929
|
+
if (strict == null) {
|
1930
|
+
strict = false;
|
1931
|
+
}
|
1932
|
+
group = strict ? this.group_separator : this.separator_chars;
|
1933
|
+
decimal = strict ? this.decimal_separator : this.separator_chars;
|
1934
|
+
return {
|
1935
|
+
group: group,
|
1936
|
+
decimal: decimal
|
1937
|
+
};
|
1938
|
+
};
|
1939
|
+
|
1940
|
+
NumberParser.prototype.tokenize = function(number_text, group, decimal) {
|
1941
|
+
var match, match_data, regexp, token, tokens, _i, _len, _results;
|
1942
|
+
regexp = new RegExp("([\\d]*)([" + group + "]{0,1})([\\d]*)([" + decimal + "]{0,1})([\\d]*)");
|
1943
|
+
match_data = number_text.split(regexp);
|
1944
|
+
match_data = (function() {
|
1945
|
+
var _i, _len, _results;
|
1946
|
+
_results = [];
|
1947
|
+
for (_i = 0, _len = match_data.length; _i < _len; _i++) {
|
1948
|
+
match = match_data[_i];
|
1949
|
+
if (match !== "") {
|
1950
|
+
_results.push(match);
|
1951
|
+
}
|
1952
|
+
}
|
1953
|
+
return _results;
|
1954
|
+
})();
|
1955
|
+
tokens = (function() {
|
1956
|
+
var _i, _len, _results;
|
1957
|
+
_results = [];
|
1958
|
+
for (_i = 0, _len = match_data.length; _i < _len; _i++) {
|
1959
|
+
match = match_data[_i];
|
1960
|
+
_results.push(this.identify(match, group, decimal));
|
1961
|
+
}
|
1962
|
+
return _results;
|
1963
|
+
}).call(this);
|
1964
|
+
_results = [];
|
1965
|
+
for (_i = 0, _len = tokens.length; _i < _len; _i++) {
|
1966
|
+
token = tokens[_i];
|
1967
|
+
if (token.type !== null) {
|
1968
|
+
_results.push(token);
|
1969
|
+
}
|
1970
|
+
}
|
1971
|
+
return _results;
|
1972
|
+
};
|
1973
|
+
|
1974
|
+
NumberParser.prototype.identify = function(text, group, decimal) {
|
1975
|
+
var decimal_regexp, group_regexp, result;
|
1976
|
+
result = {
|
1977
|
+
value: text
|
1978
|
+
};
|
1979
|
+
result.type = NumberParser.is_numeric(result.value, "") ? "numeric" : (group_regexp = new RegExp("[" + group + "]"), decimal_regexp = new RegExp("[" + decimal + "]"), group_regexp.test(result.value) ? "group" : decimal_regexp.test(result.value) ? "decimal" : null);
|
1980
|
+
return result;
|
1981
|
+
};
|
1982
|
+
|
1983
|
+
return NumberParser;
|
1984
|
+
|
1985
|
+
})();
|
1986
|
+
|
1876
1987
|
root = typeof exports !== "undefined" && exports !== null ? exports : (this.TwitterCldr = {}, this.TwitterCldr);
|
1877
1988
|
|
1878
1989
|
for (key in TwitterCldr) {
|