@js-joda/locale 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/js-joda-locale.js +1082 -1296
- package/dist/js-joda-locale.js.map +1 -1
- package/dist/js-joda-locale.min.js +9 -36
- package/dist/prebuilt/de/index.js +1092 -1306
- package/dist/prebuilt/de/index.js.map +1 -1
- package/dist/prebuilt/de-de/index.js +1092 -1306
- package/dist/prebuilt/de-de/index.js.map +1 -1
- package/dist/prebuilt/en/index.js +1093 -1307
- package/dist/prebuilt/en/index.js.map +1 -1
- package/dist/prebuilt/en-us/index.js +1092 -1306
- package/dist/prebuilt/en-us/index.js.map +1 -1
- package/dist/prebuilt/es/index.js +1093 -1307
- package/dist/prebuilt/es/index.js.map +1 -1
- package/dist/prebuilt/fr/index.js +1093 -1307
- package/dist/prebuilt/fr/index.js.map +1 -1
- package/dist/prebuilt/fr-fr/index.js +1092 -1306
- package/dist/prebuilt/fr-fr/index.js.map +1 -1
- package/dist/prebuilt/hi/index.js +1092 -1306
- package/dist/prebuilt/hi/index.js.map +1 -1
- package/dist/prebuilt/it/index.js +1092 -1306
- package/dist/prebuilt/it/index.js.map +1 -1
- package/dist/prebuilt/it-it/index.js +1092 -1306
- package/dist/prebuilt/it-it/index.js.map +1 -1
- package/dist/prebuilt/ja/index.js +1092 -1306
- package/dist/prebuilt/ja/index.js.map +1 -1
- package/dist/prebuilt/ja-jp/index.js +1092 -1306
- package/dist/prebuilt/ja-jp/index.js.map +1 -1
- package/dist/prebuilt/ko/index.js +1092 -1306
- package/dist/prebuilt/ko/index.js.map +1 -1
- package/dist/prebuilt/ro/index.js +1092 -1306
- package/dist/prebuilt/ro/index.js.map +1 -1
- package/dist/prebuilt/ru/index.js +1092 -1306
- package/dist/prebuilt/ru/index.js.map +1 -1
- package/dist/prebuilt/sv/index.js +1092 -1306
- package/dist/prebuilt/sv/index.js.map +1 -1
- package/dist/prebuilt/sv-se/index.js +1092 -1306
- package/dist/prebuilt/sv-se/index.js.map +1 -1
- package/dist/prebuilt/zh/index.js +1092 -1306
- package/dist/prebuilt/zh/index.js.map +1 -1
- package/package.json +5 -5
package/dist/js-joda-locale.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! @version @js-joda/locale - 4.
|
|
1
|
+
//! @version @js-joda/locale - 4.5.0
|
|
2
2
|
//! @copyright (c) 2015-2016, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
4
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
@@ -113,12 +113,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
113
113
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Locale; });
|
|
114
114
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_init", function() { return _init; });
|
|
115
115
|
/* harmony import */ var _format_cldr_CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format/cldr/CldrDateTimeTextProvider */ "./src/format/cldr/CldrDateTimeTextProvider.js");
|
|
116
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
117
|
-
|
|
118
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
119
|
-
|
|
120
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
121
|
-
|
|
122
116
|
/*
|
|
123
117
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
124
118
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -126,64 +120,61 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
126
120
|
|
|
127
121
|
|
|
128
122
|
var Locale = function () {
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
123
|
+
Locale.getAvailableLocales = function getAvailableLocales() {
|
|
124
|
+
return new _format_cldr_CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_0__["default"]().getAvailableLocales();
|
|
125
|
+
};
|
|
132
126
|
|
|
133
|
-
|
|
127
|
+
function Locale(language, country, localeString) {
|
|
128
|
+
if (country === void 0) {
|
|
129
|
+
country = '';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (localeString === void 0) {
|
|
133
|
+
localeString = '';
|
|
134
|
+
}
|
|
134
135
|
|
|
135
136
|
this._language = language;
|
|
136
137
|
this._country = country;
|
|
137
138
|
this._localeString = localeString;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
key: "language",
|
|
142
|
-
value: function language() {
|
|
143
|
-
return this._language;
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
key: "country",
|
|
147
|
-
value: function country() {
|
|
148
|
-
return this._country;
|
|
149
|
-
}
|
|
150
|
-
}, {
|
|
151
|
-
key: "localeString",
|
|
152
|
-
value: function localeString() {
|
|
153
|
-
if (this._localeString.length > 0) {
|
|
154
|
-
return this._localeString;
|
|
155
|
-
}
|
|
141
|
+
var _proto = Locale.prototype;
|
|
156
142
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
143
|
+
_proto.language = function language() {
|
|
144
|
+
return this._language;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
_proto.country = function country() {
|
|
148
|
+
return this._country;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
_proto.localeString = function localeString() {
|
|
152
|
+
if (this._localeString.length > 0) {
|
|
153
|
+
return this._localeString;
|
|
162
154
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
|
|
156
|
+
if (this._country.length > 0) {
|
|
157
|
+
return this._language + "-" + this._country;
|
|
158
|
+
} else {
|
|
159
|
+
return this._language;
|
|
167
160
|
}
|
|
168
|
-
}
|
|
169
|
-
key: "equals",
|
|
170
|
-
value: function equals(other) {
|
|
171
|
-
if (!other) {
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
161
|
+
};
|
|
174
162
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
163
|
+
_proto.toString = function toString() {
|
|
164
|
+
return "Locale[" + this.localeString() + "]";
|
|
165
|
+
};
|
|
178
166
|
|
|
179
|
-
|
|
167
|
+
_proto.equals = function equals(other) {
|
|
168
|
+
if (!other) {
|
|
169
|
+
return false;
|
|
180
170
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return new _format_cldr_CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_0__["default"]().getAvailableLocales();
|
|
171
|
+
|
|
172
|
+
if (!(other instanceof Locale)) {
|
|
173
|
+
return false;
|
|
185
174
|
}
|
|
186
|
-
|
|
175
|
+
|
|
176
|
+
return this.localeString() === other.localeString();
|
|
177
|
+
};
|
|
187
178
|
|
|
188
179
|
return Locale;
|
|
189
180
|
}();
|
|
@@ -264,28 +255,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
264
255
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
265
256
|
/* harmony import */ var _Locale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Locale */ "./src/Locale.js");
|
|
266
257
|
/* harmony import */ var _cldr_CldrDateTimeFormatterBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cldr/CldrDateTimeFormatterBuilder */ "./src/format/cldr/CldrDateTimeFormatterBuilder.js");
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
270
|
-
|
|
271
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
272
|
-
|
|
273
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
274
|
-
|
|
275
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
258
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
276
259
|
|
|
277
260
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
278
261
|
|
|
279
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
280
|
-
|
|
281
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
282
|
-
|
|
283
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
284
|
-
|
|
285
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
286
|
-
|
|
287
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
288
|
-
|
|
289
262
|
/*
|
|
290
263
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
291
264
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -296,28 +269,23 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
296
269
|
var requireNonNull = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].assert.requireNonNull;
|
|
297
270
|
|
|
298
271
|
var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
var _super = _createSuper(LocaleDateTimeFormatter);
|
|
272
|
+
_inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
|
|
302
273
|
|
|
303
274
|
function LocaleDateTimeFormatter() {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
return _super.apply(this, arguments);
|
|
275
|
+
return _DateTimeFormatter.apply(this, arguments) || this;
|
|
307
276
|
}
|
|
308
277
|
|
|
309
|
-
|
|
310
|
-
key: "withLocale",
|
|
311
|
-
value: function withLocale(locale) {
|
|
312
|
-
requireNonNull(locale, 'locale');
|
|
278
|
+
var _proto = LocaleDateTimeFormatter.prototype;
|
|
313
279
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
280
|
+
_proto.withLocale = function withLocale(locale) {
|
|
281
|
+
requireNonNull(locale, 'locale');
|
|
317
282
|
|
|
318
|
-
|
|
283
|
+
if (locale.equals(this._locale)) {
|
|
284
|
+
return this;
|
|
319
285
|
}
|
|
320
|
-
|
|
286
|
+
|
|
287
|
+
return new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatter"](this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
|
|
288
|
+
};
|
|
321
289
|
|
|
322
290
|
return LocaleDateTimeFormatter;
|
|
323
291
|
}(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatter"]);
|
|
@@ -363,12 +331,6 @@ function _init() {
|
|
|
363
331
|
__webpack_require__.r(__webpack_exports__);
|
|
364
332
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEntry", function() { return createEntry; });
|
|
365
333
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocaleStore", function() { return LocaleStore; });
|
|
366
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
367
|
-
|
|
368
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
369
|
-
|
|
370
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
371
|
-
|
|
372
334
|
/*
|
|
373
335
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
374
336
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -378,7 +340,7 @@ var createEntry = function createEntry(text, field) {
|
|
|
378
340
|
key: text,
|
|
379
341
|
value: field,
|
|
380
342
|
toString: function toString() {
|
|
381
|
-
return
|
|
343
|
+
return text + "->" + field;
|
|
382
344
|
}
|
|
383
345
|
};
|
|
384
346
|
};
|
|
@@ -389,8 +351,6 @@ var _comparator = function _comparator(obj1, obj2) {
|
|
|
389
351
|
|
|
390
352
|
var LocaleStore = function () {
|
|
391
353
|
function LocaleStore(valueTextMap) {
|
|
392
|
-
_classCallCheck(this, LocaleStore);
|
|
393
|
-
|
|
394
354
|
this._valueTextMap = valueTextMap;
|
|
395
355
|
var map = {};
|
|
396
356
|
var allList = [];
|
|
@@ -414,19 +374,17 @@ var LocaleStore = function () {
|
|
|
414
374
|
this._parsable = map;
|
|
415
375
|
}
|
|
416
376
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
}]);
|
|
377
|
+
var _proto = LocaleStore.prototype;
|
|
378
|
+
|
|
379
|
+
_proto.getText = function getText(value, style) {
|
|
380
|
+
var map = this._valueTextMap[style];
|
|
381
|
+
return map != null ? map[value] : null;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
_proto.getTextIterator = function getTextIterator(style) {
|
|
385
|
+
var list = this._parsable[style];
|
|
386
|
+
return list != null ? list[Symbol.iterator]() : null;
|
|
387
|
+
};
|
|
430
388
|
|
|
431
389
|
return LocaleStore;
|
|
432
390
|
}();
|
|
@@ -509,28 +467,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
509
467
|
/* harmony import */ var _LocaleStore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../LocaleStore */ "./src/format/LocaleStore.js");
|
|
510
468
|
/* harmony import */ var _parser_LocalizedOffsetPrinterParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../parser/LocalizedOffsetPrinterParser */ "./src/format/parser/LocalizedOffsetPrinterParser.js");
|
|
511
469
|
/* harmony import */ var _parser_WeekFieldsPrinterParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../parser/WeekFieldsPrinterParser */ "./src/format/parser/WeekFieldsPrinterParser.js");
|
|
512
|
-
function
|
|
513
|
-
|
|
514
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
515
|
-
|
|
516
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
517
|
-
|
|
518
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
519
|
-
|
|
520
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
470
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
521
471
|
|
|
522
472
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
523
473
|
|
|
524
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
525
|
-
|
|
526
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
527
|
-
|
|
528
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
529
|
-
|
|
530
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
531
|
-
|
|
532
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
533
|
-
|
|
534
474
|
/**
|
|
535
475
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
536
476
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -548,98 +488,87 @@ var _jodaInternal$assert = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].asser
|
|
|
548
488
|
requireInstance = _jodaInternal$assert.requireInstance;
|
|
549
489
|
|
|
550
490
|
var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
var _super = _createSuper(CldrDateTimeFormatterBuilder);
|
|
491
|
+
_inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
|
|
554
492
|
|
|
555
493
|
function CldrDateTimeFormatterBuilder() {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
return _super.apply(this, arguments);
|
|
494
|
+
return _DateTimeFormatterBui.apply(this, arguments) || this;
|
|
559
495
|
}
|
|
560
496
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}, {
|
|
573
|
-
key: "appendTextField",
|
|
574
|
-
value: function appendTextField(field) {
|
|
575
|
-
return this.appendTextFieldStyle(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL);
|
|
497
|
+
var _proto = CldrDateTimeFormatterBuilder.prototype;
|
|
498
|
+
|
|
499
|
+
_proto.appendText = function appendText(field, styleOrMap) {
|
|
500
|
+
if (styleOrMap === undefined) {
|
|
501
|
+
return this.appendTextField(field);
|
|
502
|
+
} else if (styleOrMap instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"]) {
|
|
503
|
+
return this.appendTextFieldStyle(field, styleOrMap);
|
|
504
|
+
} else {
|
|
505
|
+
return this.appendTextFieldMap(field, styleOrMap);
|
|
576
506
|
}
|
|
577
|
-
}
|
|
578
|
-
key: "appendTextFieldStyle",
|
|
579
|
-
value: function appendTextFieldStyle(field, textStyle) {
|
|
580
|
-
requireNonNull(field, 'field');
|
|
581
|
-
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalField"], 'field');
|
|
582
|
-
requireNonNull(textStyle, 'textStyle');
|
|
583
|
-
requireInstance(textStyle, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"], 'textStyle');
|
|
507
|
+
};
|
|
584
508
|
|
|
585
|
-
|
|
509
|
+
_proto.appendTextField = function appendTextField(field) {
|
|
510
|
+
return this.appendTextFieldStyle(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL);
|
|
511
|
+
};
|
|
586
512
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
requireNonNull(field, 'field');
|
|
593
|
-
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"], 'field');
|
|
594
|
-
requireNonNull(textLookup, 'textLookup');
|
|
595
|
-
var copy = Object.assign({}, textLookup);
|
|
596
|
-
var map = {};
|
|
597
|
-
map[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = copy;
|
|
598
|
-
var store = new _LocaleStore__WEBPACK_IMPORTED_MODULE_4__["LocaleStore"](map);
|
|
599
|
-
var provider = {
|
|
600
|
-
getText: function getText(field, value, style) {
|
|
601
|
-
return store.getText(value, style);
|
|
602
|
-
},
|
|
603
|
-
getTextIterator: function getTextIterator(field, style) {
|
|
604
|
-
return store.getTextIterator(style);
|
|
605
|
-
}
|
|
606
|
-
};
|
|
513
|
+
_proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
|
|
514
|
+
requireNonNull(field, 'field');
|
|
515
|
+
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalField"], 'field');
|
|
516
|
+
requireNonNull(textStyle, 'textStyle');
|
|
517
|
+
requireInstance(textStyle, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"], 'textStyle');
|
|
607
518
|
|
|
608
|
-
|
|
519
|
+
this._appendInternal(new _parser_TextPrinterParser__WEBPACK_IMPORTED_MODULE_1__["default"](field, textStyle, new _CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_2__["default"]()));
|
|
609
520
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
521
|
+
return this;
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
_proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
|
|
525
|
+
requireNonNull(field, 'field');
|
|
526
|
+
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"], 'field');
|
|
527
|
+
requireNonNull(textLookup, 'textLookup');
|
|
528
|
+
var copy = Object.assign({}, textLookup);
|
|
529
|
+
var map = {};
|
|
530
|
+
map[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = copy;
|
|
531
|
+
var store = new _LocaleStore__WEBPACK_IMPORTED_MODULE_4__["LocaleStore"](map);
|
|
532
|
+
var provider = {
|
|
533
|
+
getText: function getText(field, value, style) {
|
|
534
|
+
return store.getText(value, style);
|
|
535
|
+
},
|
|
536
|
+
getTextIterator: function getTextIterator(field, style) {
|
|
537
|
+
return store.getTextIterator(style);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
617
540
|
|
|
618
|
-
|
|
541
|
+
this._appendInternal(new _parser_TextPrinterParser__WEBPACK_IMPORTED_MODULE_1__["default"](field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL, provider));
|
|
619
542
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}, {
|
|
623
|
-
key: "appendZoneText",
|
|
624
|
-
value: function appendZoneText(textStyle) {
|
|
625
|
-
this._appendInternal(new _CldrZoneTextPrinterParser__WEBPACK_IMPORTED_MODULE_3__["default"](textStyle));
|
|
543
|
+
return this;
|
|
544
|
+
};
|
|
626
545
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
key: "appendLocalizedOffset",
|
|
631
|
-
value: function appendLocalizedOffset(textStyle) {
|
|
632
|
-
requireNonNull(textStyle, 'textStyle');
|
|
546
|
+
_proto.appendWeekField = function appendWeekField(field, count) {
|
|
547
|
+
requireNonNull(field, 'field');
|
|
548
|
+
requireNonNull(count, 'count');
|
|
633
549
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
550
|
+
this._appendInternal(new _parser_WeekFieldsPrinterParser__WEBPACK_IMPORTED_MODULE_6__["default"](field, count));
|
|
551
|
+
|
|
552
|
+
return this;
|
|
553
|
+
};
|
|
637
554
|
|
|
638
|
-
|
|
555
|
+
_proto.appendZoneText = function appendZoneText(textStyle) {
|
|
556
|
+
this._appendInternal(new _CldrZoneTextPrinterParser__WEBPACK_IMPORTED_MODULE_3__["default"](textStyle));
|
|
639
557
|
|
|
640
|
-
|
|
558
|
+
return this;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
_proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
|
|
562
|
+
requireNonNull(textStyle, 'textStyle');
|
|
563
|
+
|
|
564
|
+
if (textStyle !== _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL && textStyle !== _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT) {
|
|
565
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]('Style must be either full or short');
|
|
641
566
|
}
|
|
642
|
-
|
|
567
|
+
|
|
568
|
+
this._appendInternal(new _parser_LocalizedOffsetPrinterParser__WEBPACK_IMPORTED_MODULE_5__["default"](textStyle));
|
|
569
|
+
|
|
570
|
+
return this;
|
|
571
|
+
};
|
|
643
572
|
|
|
644
573
|
return CldrDateTimeFormatterBuilder;
|
|
645
574
|
}(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"]);
|
|
@@ -664,12 +593,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
664
593
|
/* harmony import */ var cldr_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cldr_data__WEBPACK_IMPORTED_MODULE_1__);
|
|
665
594
|
/* harmony import */ var _LocaleStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../LocaleStore */ "./src/format/LocaleStore.js");
|
|
666
595
|
/* harmony import */ var _CldrCache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CldrCache */ "./src/format/cldr/CldrCache.js");
|
|
667
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
668
|
-
|
|
669
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
670
|
-
|
|
671
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
672
|
-
|
|
673
596
|
/*
|
|
674
597
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
675
598
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -681,218 +604,210 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
681
604
|
|
|
682
605
|
var CldrDateTimeTextProvider = function () {
|
|
683
606
|
function CldrDateTimeTextProvider() {
|
|
684
|
-
_classCallCheck(this, CldrDateTimeTextProvider);
|
|
685
|
-
|
|
686
607
|
this._cache = {};
|
|
687
608
|
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["loadCldrData"])('supplemental/likelySubtags.json');
|
|
688
609
|
}
|
|
689
610
|
|
|
690
|
-
|
|
691
|
-
key: "getAvailableLocales",
|
|
692
|
-
value: function getAvailableLocales() {
|
|
693
|
-
if (typeof JS_JODA_LOCALE_AVAILABLE_LOCALES !== 'undefined') {
|
|
694
|
-
return JS_JODA_LOCALE_AVAILABLE_LOCALES;
|
|
695
|
-
}
|
|
611
|
+
var _proto = CldrDateTimeTextProvider.prototype;
|
|
696
612
|
|
|
697
|
-
|
|
613
|
+
_proto.getAvailableLocales = function getAvailableLocales() {
|
|
614
|
+
if (typeof JS_JODA_LOCALE_AVAILABLE_LOCALES !== 'undefined') {
|
|
615
|
+
return JS_JODA_LOCALE_AVAILABLE_LOCALES;
|
|
698
616
|
}
|
|
699
|
-
}, {
|
|
700
|
-
key: "getText",
|
|
701
|
-
value: function getText(field, value, style, locale) {
|
|
702
|
-
var store = this._findStore(field, locale);
|
|
703
617
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
618
|
+
return cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('availableLocales.json').availableLocales;
|
|
619
|
+
};
|
|
707
620
|
|
|
708
|
-
|
|
621
|
+
_proto.getText = function getText(field, value, style, locale) {
|
|
622
|
+
var store = this._findStore(field, locale);
|
|
623
|
+
|
|
624
|
+
if (store instanceof _LocaleStore__WEBPACK_IMPORTED_MODULE_2__["LocaleStore"]) {
|
|
625
|
+
return store.getText(value, style);
|
|
709
626
|
}
|
|
710
|
-
}, {
|
|
711
|
-
key: "getTextIterator",
|
|
712
|
-
value: function getTextIterator(field, style, locale) {
|
|
713
|
-
var store = this._findStore(field, locale);
|
|
714
627
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
628
|
+
return null;
|
|
629
|
+
};
|
|
718
630
|
|
|
719
|
-
|
|
631
|
+
_proto.getTextIterator = function getTextIterator(field, style, locale) {
|
|
632
|
+
var store = this._findStore(field, locale);
|
|
633
|
+
|
|
634
|
+
if (store instanceof _LocaleStore__WEBPACK_IMPORTED_MODULE_2__["LocaleStore"]) {
|
|
635
|
+
return store.getTextIterator(style);
|
|
720
636
|
}
|
|
721
|
-
}, {
|
|
722
|
-
key: "_findStore",
|
|
723
|
-
value: function _findStore(field, locale) {
|
|
724
|
-
var key = Object(_LocaleStore__WEBPACK_IMPORTED_MODULE_2__["createEntry"])(field, locale);
|
|
725
|
-
var store = this._cache[key];
|
|
726
637
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
this._cache[key] = store;
|
|
730
|
-
}
|
|
638
|
+
return null;
|
|
639
|
+
};
|
|
731
640
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
key: "_createStore",
|
|
736
|
-
value: function _createStore(field, locale) {
|
|
737
|
-
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["loadCldrData"])("main/".concat(locale.localeString(), "/ca-gregorian.json"));
|
|
738
|
-
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["getOrCreateCldrInstance"])(locale.localeString());
|
|
739
|
-
|
|
740
|
-
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) {
|
|
741
|
-
var monthsData = cldr.main('dates/calendars/gregorian/months/format');
|
|
742
|
-
var styleMap = {};
|
|
743
|
-
var data = {};
|
|
744
|
-
data[1] = monthsData.wide[1];
|
|
745
|
-
data[2] = monthsData.wide[2];
|
|
746
|
-
data[3] = monthsData.wide[3];
|
|
747
|
-
data[4] = monthsData.wide[4];
|
|
748
|
-
data[5] = monthsData.wide[5];
|
|
749
|
-
data[6] = monthsData.wide[6];
|
|
750
|
-
data[7] = monthsData.wide[7];
|
|
751
|
-
data[8] = monthsData.wide[8];
|
|
752
|
-
data[9] = monthsData.wide[9];
|
|
753
|
-
data[10] = monthsData.wide[10];
|
|
754
|
-
data[11] = monthsData.wide[11];
|
|
755
|
-
data[12] = monthsData.wide[12];
|
|
756
|
-
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = data;
|
|
757
|
-
data = {};
|
|
758
|
-
data[1] = monthsData.narrow[1];
|
|
759
|
-
data[2] = monthsData.narrow[2];
|
|
760
|
-
data[3] = monthsData.narrow[3];
|
|
761
|
-
data[4] = monthsData.narrow[4];
|
|
762
|
-
data[5] = monthsData.narrow[5];
|
|
763
|
-
data[6] = monthsData.narrow[6];
|
|
764
|
-
data[7] = monthsData.narrow[7];
|
|
765
|
-
data[8] = monthsData.narrow[8];
|
|
766
|
-
data[9] = monthsData.narrow[9];
|
|
767
|
-
data[10] = monthsData.narrow[10];
|
|
768
|
-
data[11] = monthsData.narrow[11];
|
|
769
|
-
data[12] = monthsData.narrow[12];
|
|
770
|
-
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = data;
|
|
771
|
-
data = {};
|
|
772
|
-
data[1] = monthsData.abbreviated[1];
|
|
773
|
-
data[2] = monthsData.abbreviated[2];
|
|
774
|
-
data[3] = monthsData.abbreviated[3];
|
|
775
|
-
data[4] = monthsData.abbreviated[4];
|
|
776
|
-
data[5] = monthsData.abbreviated[5];
|
|
777
|
-
data[6] = monthsData.abbreviated[6];
|
|
778
|
-
data[7] = monthsData.abbreviated[7];
|
|
779
|
-
data[8] = monthsData.abbreviated[8];
|
|
780
|
-
data[9] = monthsData.abbreviated[9];
|
|
781
|
-
data[10] = monthsData.abbreviated[10];
|
|
782
|
-
data[11] = monthsData.abbreviated[11];
|
|
783
|
-
data[12] = monthsData.abbreviated[12];
|
|
784
|
-
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = data;
|
|
785
|
-
return this._createLocaleStore(styleMap);
|
|
786
|
-
}
|
|
641
|
+
_proto._findStore = function _findStore(field, locale) {
|
|
642
|
+
var key = Object(_LocaleStore__WEBPACK_IMPORTED_MODULE_2__["createEntry"])(field, locale);
|
|
643
|
+
var store = this._cache[key];
|
|
787
644
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
_data[1] = daysData.wide.mon;
|
|
793
|
-
_data[2] = daysData.wide.tue;
|
|
794
|
-
_data[3] = daysData.wide.wed;
|
|
795
|
-
_data[4] = daysData.wide.thu;
|
|
796
|
-
_data[5] = daysData.wide.fri;
|
|
797
|
-
_data[6] = daysData.wide.sat;
|
|
798
|
-
_data[7] = daysData.wide.sun;
|
|
799
|
-
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data;
|
|
800
|
-
_data = {};
|
|
801
|
-
_data[1] = daysData.narrow.mon;
|
|
802
|
-
_data[2] = daysData.narrow.tue;
|
|
803
|
-
_data[3] = daysData.narrow.wed;
|
|
804
|
-
_data[4] = daysData.narrow.thu;
|
|
805
|
-
_data[5] = daysData.narrow.fri;
|
|
806
|
-
_data[6] = daysData.narrow.sat;
|
|
807
|
-
_data[7] = daysData.narrow.sun;
|
|
808
|
-
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data;
|
|
809
|
-
_data = {};
|
|
810
|
-
_data[1] = daysData.abbreviated.mon;
|
|
811
|
-
_data[2] = daysData.abbreviated.tue;
|
|
812
|
-
_data[3] = daysData.abbreviated.wed;
|
|
813
|
-
_data[4] = daysData.abbreviated.thu;
|
|
814
|
-
_data[5] = daysData.abbreviated.fri;
|
|
815
|
-
_data[6] = daysData.abbreviated.sat;
|
|
816
|
-
_data[7] = daysData.abbreviated.sun;
|
|
817
|
-
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data;
|
|
818
|
-
return this._createLocaleStore(_styleMap);
|
|
819
|
-
}
|
|
645
|
+
if (store === undefined) {
|
|
646
|
+
store = this._createStore(field, locale);
|
|
647
|
+
this._cache[key] = store;
|
|
648
|
+
}
|
|
820
649
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
var _styleMap2 = {};
|
|
824
|
-
var _data2 = {};
|
|
825
|
-
_data2[0] = dayPeriodsData.wide.am;
|
|
826
|
-
_data2[1] = dayPeriodsData.wide.pm;
|
|
827
|
-
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data2;
|
|
828
|
-
_data2 = {};
|
|
829
|
-
_data2[0] = dayPeriodsData.narrow.am;
|
|
830
|
-
_data2[1] = dayPeriodsData.narrow.pm;
|
|
831
|
-
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data2;
|
|
832
|
-
_data2 = {};
|
|
833
|
-
_data2[0] = dayPeriodsData.abbreviated.am;
|
|
834
|
-
_data2[1] = dayPeriodsData.abbreviated.pm;
|
|
835
|
-
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data2;
|
|
836
|
-
return this._createLocaleStore(_styleMap2);
|
|
837
|
-
}
|
|
650
|
+
return store;
|
|
651
|
+
};
|
|
838
652
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
653
|
+
_proto._createStore = function _createStore(field, locale) {
|
|
654
|
+
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["loadCldrData"])("main/" + locale.localeString() + "/ca-gregorian.json");
|
|
655
|
+
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["getOrCreateCldrInstance"])(locale.localeString());
|
|
656
|
+
|
|
657
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) {
|
|
658
|
+
var monthsData = cldr.main('dates/calendars/gregorian/months/format');
|
|
659
|
+
var styleMap = {};
|
|
660
|
+
var data = {};
|
|
661
|
+
data[1] = monthsData.wide[1];
|
|
662
|
+
data[2] = monthsData.wide[2];
|
|
663
|
+
data[3] = monthsData.wide[3];
|
|
664
|
+
data[4] = monthsData.wide[4];
|
|
665
|
+
data[5] = monthsData.wide[5];
|
|
666
|
+
data[6] = monthsData.wide[6];
|
|
667
|
+
data[7] = monthsData.wide[7];
|
|
668
|
+
data[8] = monthsData.wide[8];
|
|
669
|
+
data[9] = monthsData.wide[9];
|
|
670
|
+
data[10] = monthsData.wide[10];
|
|
671
|
+
data[11] = monthsData.wide[11];
|
|
672
|
+
data[12] = monthsData.wide[12];
|
|
673
|
+
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = data;
|
|
674
|
+
data = {};
|
|
675
|
+
data[1] = monthsData.narrow[1];
|
|
676
|
+
data[2] = monthsData.narrow[2];
|
|
677
|
+
data[3] = monthsData.narrow[3];
|
|
678
|
+
data[4] = monthsData.narrow[4];
|
|
679
|
+
data[5] = monthsData.narrow[5];
|
|
680
|
+
data[6] = monthsData.narrow[6];
|
|
681
|
+
data[7] = monthsData.narrow[7];
|
|
682
|
+
data[8] = monthsData.narrow[8];
|
|
683
|
+
data[9] = monthsData.narrow[9];
|
|
684
|
+
data[10] = monthsData.narrow[10];
|
|
685
|
+
data[11] = monthsData.narrow[11];
|
|
686
|
+
data[12] = monthsData.narrow[12];
|
|
687
|
+
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = data;
|
|
688
|
+
data = {};
|
|
689
|
+
data[1] = monthsData.abbreviated[1];
|
|
690
|
+
data[2] = monthsData.abbreviated[2];
|
|
691
|
+
data[3] = monthsData.abbreviated[3];
|
|
692
|
+
data[4] = monthsData.abbreviated[4];
|
|
693
|
+
data[5] = monthsData.abbreviated[5];
|
|
694
|
+
data[6] = monthsData.abbreviated[6];
|
|
695
|
+
data[7] = monthsData.abbreviated[7];
|
|
696
|
+
data[8] = monthsData.abbreviated[8];
|
|
697
|
+
data[9] = monthsData.abbreviated[9];
|
|
698
|
+
data[10] = monthsData.abbreviated[10];
|
|
699
|
+
data[11] = monthsData.abbreviated[11];
|
|
700
|
+
data[12] = monthsData.abbreviated[12];
|
|
701
|
+
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = data;
|
|
702
|
+
return this._createLocaleStore(styleMap);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK) {
|
|
706
|
+
var daysData = cldr.main('dates/calendars/gregorian/days/format');
|
|
707
|
+
var _styleMap = {};
|
|
708
|
+
var _data = {};
|
|
709
|
+
_data[1] = daysData.wide.mon;
|
|
710
|
+
_data[2] = daysData.wide.tue;
|
|
711
|
+
_data[3] = daysData.wide.wed;
|
|
712
|
+
_data[4] = daysData.wide.thu;
|
|
713
|
+
_data[5] = daysData.wide.fri;
|
|
714
|
+
_data[6] = daysData.wide.sat;
|
|
715
|
+
_data[7] = daysData.wide.sun;
|
|
716
|
+
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data;
|
|
717
|
+
_data = {};
|
|
718
|
+
_data[1] = daysData.narrow.mon;
|
|
719
|
+
_data[2] = daysData.narrow.tue;
|
|
720
|
+
_data[3] = daysData.narrow.wed;
|
|
721
|
+
_data[4] = daysData.narrow.thu;
|
|
722
|
+
_data[5] = daysData.narrow.fri;
|
|
723
|
+
_data[6] = daysData.narrow.sat;
|
|
724
|
+
_data[7] = daysData.narrow.sun;
|
|
725
|
+
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data;
|
|
726
|
+
_data = {};
|
|
727
|
+
_data[1] = daysData.abbreviated.mon;
|
|
728
|
+
_data[2] = daysData.abbreviated.tue;
|
|
729
|
+
_data[3] = daysData.abbreviated.wed;
|
|
730
|
+
_data[4] = daysData.abbreviated.thu;
|
|
731
|
+
_data[5] = daysData.abbreviated.fri;
|
|
732
|
+
_data[6] = daysData.abbreviated.sat;
|
|
733
|
+
_data[7] = daysData.abbreviated.sun;
|
|
734
|
+
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data;
|
|
735
|
+
return this._createLocaleStore(_styleMap);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].AMPM_OF_DAY) {
|
|
739
|
+
var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
|
|
740
|
+
var _styleMap2 = {};
|
|
741
|
+
var _data2 = {};
|
|
742
|
+
_data2[0] = dayPeriodsData.wide.am;
|
|
743
|
+
_data2[1] = dayPeriodsData.wide.pm;
|
|
744
|
+
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data2;
|
|
745
|
+
_data2 = {};
|
|
746
|
+
_data2[0] = dayPeriodsData.narrow.am;
|
|
747
|
+
_data2[1] = dayPeriodsData.narrow.pm;
|
|
748
|
+
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data2;
|
|
749
|
+
_data2 = {};
|
|
750
|
+
_data2[0] = dayPeriodsData.abbreviated.am;
|
|
751
|
+
_data2[1] = dayPeriodsData.abbreviated.pm;
|
|
752
|
+
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data2;
|
|
753
|
+
return this._createLocaleStore(_styleMap2);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].ERA) {
|
|
757
|
+
var erasData = cldr.main('dates/calendars/gregorian/eras');
|
|
758
|
+
var _styleMap3 = {};
|
|
759
|
+
var _data3 = {};
|
|
760
|
+
_data3[0] = erasData.eraNames['0'];
|
|
761
|
+
_data3[1] = erasData.eraNames['1'];
|
|
762
|
+
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data3;
|
|
763
|
+
_data3 = {};
|
|
764
|
+
_data3[0] = erasData.eraNarrow['0'];
|
|
765
|
+
_data3[1] = erasData.eraNarrow['1'];
|
|
766
|
+
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data3;
|
|
767
|
+
_data3 = {};
|
|
768
|
+
_data3[0] = erasData.eraAbbr['0'];
|
|
769
|
+
_data3[1] = erasData.eraAbbr['1'];
|
|
770
|
+
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data3;
|
|
771
|
+
return this._createLocaleStore(_styleMap3);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].QUARTER_OF_YEAR) {
|
|
775
|
+
var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
|
|
776
|
+
var _styleMap4 = {};
|
|
777
|
+
var _data4 = {};
|
|
778
|
+
_data4[1] = quartersData.wide['1'];
|
|
779
|
+
_data4[2] = quartersData.wide['2'];
|
|
780
|
+
_data4[3] = quartersData.wide['3'];
|
|
781
|
+
_data4[4] = quartersData.wide['4'];
|
|
782
|
+
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data4;
|
|
783
|
+
_data4 = {};
|
|
784
|
+
_data4[1] = quartersData.narrow['1'];
|
|
785
|
+
_data4[2] = quartersData.narrow['2'];
|
|
786
|
+
_data4[3] = quartersData.narrow['3'];
|
|
787
|
+
_data4[4] = quartersData.narrow['4'];
|
|
788
|
+
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data4;
|
|
789
|
+
_data4 = {};
|
|
790
|
+
_data4[1] = quartersData.abbreviated['1'];
|
|
791
|
+
_data4[2] = quartersData.abbreviated['2'];
|
|
792
|
+
_data4[3] = quartersData.abbreviated['3'];
|
|
793
|
+
_data4[4] = quartersData.abbreviated['4'];
|
|
794
|
+
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data4;
|
|
795
|
+
return this._createLocaleStore(_styleMap4);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
return null;
|
|
799
|
+
};
|
|
856
800
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
var _data4 = {};
|
|
861
|
-
_data4[1] = quartersData.wide['1'];
|
|
862
|
-
_data4[2] = quartersData.wide['2'];
|
|
863
|
-
_data4[3] = quartersData.wide['3'];
|
|
864
|
-
_data4[4] = quartersData.wide['4'];
|
|
865
|
-
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data4;
|
|
866
|
-
_data4 = {};
|
|
867
|
-
_data4[1] = quartersData.narrow['1'];
|
|
868
|
-
_data4[2] = quartersData.narrow['2'];
|
|
869
|
-
_data4[3] = quartersData.narrow['3'];
|
|
870
|
-
_data4[4] = quartersData.narrow['4'];
|
|
871
|
-
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data4;
|
|
872
|
-
_data4 = {};
|
|
873
|
-
_data4[1] = quartersData.abbreviated['1'];
|
|
874
|
-
_data4[2] = quartersData.abbreviated['2'];
|
|
875
|
-
_data4[3] = quartersData.abbreviated['3'];
|
|
876
|
-
_data4[4] = quartersData.abbreviated['4'];
|
|
877
|
-
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data4;
|
|
878
|
-
return this._createLocaleStore(_styleMap4);
|
|
879
|
-
}
|
|
801
|
+
_proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
|
|
802
|
+
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL];
|
|
803
|
+
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT];
|
|
880
804
|
|
|
881
|
-
|
|
805
|
+
if (Object.keys(valueTextMap).indexOf(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW) > -1 && Object.keys(valueTextMap).indexOf(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW_STANDALONE) === -1) {
|
|
806
|
+
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW];
|
|
882
807
|
}
|
|
883
|
-
}, {
|
|
884
|
-
key: "_createLocaleStore",
|
|
885
|
-
value: function _createLocaleStore(valueTextMap) {
|
|
886
|
-
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL];
|
|
887
|
-
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT];
|
|
888
|
-
|
|
889
|
-
if (Object.keys(valueTextMap).indexOf(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW) > -1 && Object.keys(valueTextMap).indexOf(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW_STANDALONE) === -1) {
|
|
890
|
-
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW];
|
|
891
|
-
}
|
|
892
808
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}]);
|
|
809
|
+
return new _LocaleStore__WEBPACK_IMPORTED_MODULE_2__["LocaleStore"](valueTextMap);
|
|
810
|
+
};
|
|
896
811
|
|
|
897
812
|
return CldrDateTimeTextProvider;
|
|
898
813
|
}();
|
|
@@ -914,18 +829,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
914
829
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
915
830
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
916
831
|
/* harmony import */ var _CldrCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CldrCache */ "./src/format/cldr/CldrCache.js");
|
|
917
|
-
function
|
|
832
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
918
833
|
|
|
919
834
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
920
835
|
|
|
921
836
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
922
837
|
|
|
923
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
924
|
-
|
|
925
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
926
|
-
|
|
927
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
928
|
-
|
|
929
838
|
/*
|
|
930
839
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
931
840
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -950,8 +859,6 @@ var resolveZoneIdTextCache = {};
|
|
|
950
859
|
|
|
951
860
|
var CldrZoneTextPrinterParser = function () {
|
|
952
861
|
function CldrZoneTextPrinterParser(textStyle) {
|
|
953
|
-
_classCallCheck(this, CldrZoneTextPrinterParser);
|
|
954
|
-
|
|
955
862
|
requireNonNull(textStyle, 'textStyle');
|
|
956
863
|
requireInstance(textStyle, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"], 'textStyle');
|
|
957
864
|
this._textStyle = textStyle;
|
|
@@ -960,202 +867,178 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
960
867
|
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])('supplemental/metaZones.json');
|
|
961
868
|
}
|
|
962
869
|
|
|
963
|
-
|
|
964
|
-
key: "_cachedResolveZoneIdText",
|
|
965
|
-
value: function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
|
|
966
|
-
if (resolveZoneIdTextCache[cldr.locale] == null) {
|
|
967
|
-
resolveZoneIdTextCache[cldr.locale] = {};
|
|
968
|
-
}
|
|
870
|
+
var _proto = CldrZoneTextPrinterParser.prototype;
|
|
969
871
|
|
|
970
|
-
|
|
872
|
+
_proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
|
|
873
|
+
if (resolveZoneIdTextCache[cldr.locale] == null) {
|
|
874
|
+
resolveZoneIdTextCache[cldr.locale] = {};
|
|
875
|
+
}
|
|
971
876
|
|
|
972
|
-
|
|
973
|
-
zoneIdToStyle[zoneId] = {};
|
|
974
|
-
}
|
|
877
|
+
var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
|
|
975
878
|
|
|
976
|
-
|
|
879
|
+
if (zoneIdToStyle[zoneId] == null) {
|
|
880
|
+
zoneIdToStyle[zoneId] = {};
|
|
881
|
+
}
|
|
977
882
|
|
|
978
|
-
|
|
979
|
-
styleToType[style] = {};
|
|
980
|
-
}
|
|
883
|
+
var styleToType = zoneIdToStyle[zoneId];
|
|
981
884
|
|
|
982
|
-
|
|
885
|
+
if (styleToType[style] == null) {
|
|
886
|
+
styleToType[style] = {};
|
|
887
|
+
}
|
|
983
888
|
|
|
984
|
-
|
|
985
|
-
typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
|
|
986
|
-
}
|
|
889
|
+
var typeToResolvedZoneIdText = styleToType[style];
|
|
987
890
|
|
|
988
|
-
|
|
891
|
+
if (typeToResolvedZoneIdText[type] == null) {
|
|
892
|
+
typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
|
|
989
893
|
}
|
|
990
|
-
}, {
|
|
991
|
-
key: "_resolveZoneIdText",
|
|
992
|
-
value: function _resolveZoneIdText(cldr, zoneId, style, type) {
|
|
993
|
-
var zoneData = cldr.main("dates/timeZoneNames/zone/".concat(zoneId, "/").concat(style, "/").concat(type));
|
|
994
894
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
895
|
+
return typeToResolvedZoneIdText[type];
|
|
896
|
+
};
|
|
897
|
+
|
|
898
|
+
_proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
|
|
899
|
+
var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
|
|
900
|
+
|
|
901
|
+
if (zoneData) {
|
|
902
|
+
return zoneData;
|
|
903
|
+
} else {
|
|
904
|
+
var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
|
|
999
905
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
906
|
+
if (metazoneInfo) {
|
|
907
|
+
var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
|
|
908
|
+
var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
|
|
909
|
+
|
|
910
|
+
if (metaZoneData) {
|
|
911
|
+
return metaZoneData;
|
|
912
|
+
} else {
|
|
913
|
+
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
|
|
914
|
+
|
|
915
|
+
if (!metaZoneData) {
|
|
916
|
+
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
|
|
917
|
+
}
|
|
1003
918
|
|
|
1004
919
|
if (metaZoneData) {
|
|
1005
920
|
return metaZoneData;
|
|
1006
921
|
} else {
|
|
1007
|
-
|
|
922
|
+
var mapZones = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateMapZones"])(cldr);
|
|
923
|
+
var preferredZone = mapZones[metazone][cldr.attributes.territory];
|
|
1008
924
|
|
|
1009
|
-
if (
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
if (metaZoneData) {
|
|
1014
|
-
return metaZoneData;
|
|
925
|
+
if (preferredZone) {
|
|
926
|
+
if (preferredZone !== zoneId) {
|
|
927
|
+
return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
|
|
928
|
+
}
|
|
1015
929
|
} else {
|
|
1016
|
-
var
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
if (preferredZone !== zoneId) {
|
|
1021
|
-
return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
|
|
1022
|
-
}
|
|
1023
|
-
} else {
|
|
1024
|
-
var goldenZone = mapZones[metazone]['001'];
|
|
1025
|
-
|
|
1026
|
-
if (goldenZone !== zoneId) {
|
|
1027
|
-
return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
|
|
1028
|
-
}
|
|
930
|
+
var goldenZone = mapZones[metazone]['001'];
|
|
931
|
+
|
|
932
|
+
if (goldenZone !== zoneId) {
|
|
933
|
+
return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
|
|
1029
934
|
}
|
|
1030
935
|
}
|
|
1031
936
|
}
|
|
1032
937
|
}
|
|
1033
938
|
}
|
|
1034
939
|
}
|
|
1035
|
-
}
|
|
1036
|
-
key: "print",
|
|
1037
|
-
value: function print(context, buf) {
|
|
1038
|
-
var zone = context.getValueQuery(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalQueries"].zoneId());
|
|
1039
|
-
|
|
1040
|
-
if (zone == null) {
|
|
1041
|
-
return false;
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
if (zone.normalized() instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"]) {
|
|
1045
|
-
buf.append(zone.id());
|
|
1046
|
-
return true;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
var daylight = false;
|
|
1050
|
-
var hasDaylightSupport = false;
|
|
1051
|
-
var tzType = hasDaylightSupport ? daylight ? 'daylight' : 'standard' : 'generic';
|
|
1052
|
-
var tzstyle = this._textStyle.asNormal() === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL ? 'long' : 'short';
|
|
1053
|
-
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])("main/".concat(context.locale().localeString(), "/timeZoneNames.json"));
|
|
1054
|
-
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateCldrInstance"])(context.locale().localeString());
|
|
940
|
+
};
|
|
1055
941
|
|
|
1056
|
-
|
|
942
|
+
_proto.print = function print(context, buf) {
|
|
943
|
+
var zone = context.getValueQuery(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalQueries"].zoneId());
|
|
1057
944
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
buf.append(zone.id());
|
|
1062
|
-
}
|
|
945
|
+
if (zone == null) {
|
|
946
|
+
return false;
|
|
947
|
+
}
|
|
1063
948
|
|
|
949
|
+
if (zone.normalized() instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"]) {
|
|
950
|
+
buf.append(zone.id());
|
|
1064
951
|
return true;
|
|
1065
952
|
}
|
|
1066
|
-
}, {
|
|
1067
|
-
key: "_resolveZoneIds",
|
|
1068
|
-
value: function _resolveZoneIds(localString) {
|
|
1069
|
-
if (this._zoneIdsLocales[localString] != null) {
|
|
1070
|
-
return this._zoneIdsLocales[localString];
|
|
1071
|
-
}
|
|
1072
953
|
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
954
|
+
var daylight = false;
|
|
955
|
+
var hasDaylightSupport = false;
|
|
956
|
+
var tzType = hasDaylightSupport ? daylight ? 'daylight' : 'standard' : 'generic';
|
|
957
|
+
var tzstyle = this._textStyle.asNormal() === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL ? 'long' : 'short';
|
|
958
|
+
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])("main/" + context.locale().localeString() + "/timeZoneNames.json");
|
|
959
|
+
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateCldrInstance"])(context.locale().localeString());
|
|
1076
960
|
|
|
1077
|
-
|
|
1078
|
-
_step;
|
|
961
|
+
var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
|
|
1079
962
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
963
|
+
if (text) {
|
|
964
|
+
buf.append(text);
|
|
965
|
+
} else {
|
|
966
|
+
buf.append(zone.id());
|
|
967
|
+
}
|
|
1085
968
|
|
|
1086
|
-
|
|
969
|
+
return true;
|
|
970
|
+
};
|
|
1087
971
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
972
|
+
_proto._resolveZoneIds = function _resolveZoneIds(localString) {
|
|
973
|
+
if (this._zoneIdsLocales[localString] != null) {
|
|
974
|
+
return this._zoneIdsLocales[localString];
|
|
975
|
+
}
|
|
1091
976
|
|
|
1092
|
-
|
|
977
|
+
var ids = {};
|
|
978
|
+
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])("main/" + localString + "/timeZoneNames.json");
|
|
979
|
+
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateCldrInstance"])(localString);
|
|
1093
980
|
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
981
|
+
for (var _iterator = _createForOfIteratorHelperLoose(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneRulesProvider"].getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
|
|
982
|
+
var id = _step.value;
|
|
983
|
+
ids[id] = id;
|
|
984
|
+
var tzstyle = this._textStyle.asNormal() === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL ? 'long' : 'short';
|
|
1097
985
|
|
|
1098
|
-
|
|
986
|
+
var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
|
|
1099
987
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
} catch (err) {
|
|
1105
|
-
_iterator.e(err);
|
|
1106
|
-
} finally {
|
|
1107
|
-
_iterator.f();
|
|
988
|
+
if (genericText) {
|
|
989
|
+
ids[genericText] = id;
|
|
1108
990
|
}
|
|
1109
991
|
|
|
1110
|
-
var
|
|
1111
|
-
this._zoneIdsLocales[localString] = {
|
|
1112
|
-
ids: ids,
|
|
1113
|
-
sortedKeys: sortedKeys
|
|
1114
|
-
};
|
|
1115
|
-
return this._zoneIdsLocales[localString];
|
|
1116
|
-
}
|
|
1117
|
-
}, {
|
|
1118
|
-
key: "parse",
|
|
1119
|
-
value: function parse(context, text, position) {
|
|
1120
|
-
for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
|
|
1121
|
-
var name = _arr[_i];
|
|
992
|
+
var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
|
|
1122
993
|
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
return position + name.length;
|
|
1126
|
-
}
|
|
994
|
+
if (standardText) {
|
|
995
|
+
ids[standardText] = id;
|
|
1127
996
|
}
|
|
1128
997
|
|
|
1129
|
-
var
|
|
1130
|
-
ids = _this$_resolveZoneIds.ids,
|
|
1131
|
-
sortedKeys = _this$_resolveZoneIds.sortedKeys;
|
|
998
|
+
var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
|
|
1132
999
|
|
|
1133
|
-
|
|
1134
|
-
|
|
1000
|
+
if (daylightText) {
|
|
1001
|
+
ids[daylightText] = id;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1135
1004
|
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1005
|
+
var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
|
|
1006
|
+
this._zoneIdsLocales[localString] = {
|
|
1007
|
+
ids: ids,
|
|
1008
|
+
sortedKeys: sortedKeys
|
|
1009
|
+
};
|
|
1010
|
+
return this._zoneIdsLocales[localString];
|
|
1011
|
+
};
|
|
1139
1012
|
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
} catch (err) {
|
|
1146
|
-
_iterator2.e(err);
|
|
1147
|
-
} finally {
|
|
1148
|
-
_iterator2.f();
|
|
1149
|
-
}
|
|
1013
|
+
_proto.parse = function parse(context, text, position) {
|
|
1014
|
+
for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
|
|
1015
|
+
var name = _arr[_i];
|
|
1150
1016
|
|
|
1151
|
-
|
|
1017
|
+
if (context.subSequenceEquals(text, position, name, 0, name.length)) {
|
|
1018
|
+
context.setParsedZone(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneId"].of(name));
|
|
1019
|
+
return position + name.length;
|
|
1020
|
+
}
|
|
1152
1021
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1022
|
+
|
|
1023
|
+
var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
|
|
1024
|
+
ids = _this$_resolveZoneIds.ids,
|
|
1025
|
+
sortedKeys = _this$_resolveZoneIds.sortedKeys;
|
|
1026
|
+
|
|
1027
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
|
|
1028
|
+
var _name = _step2.value;
|
|
1029
|
+
|
|
1030
|
+
if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
|
|
1031
|
+
context.setParsedZone(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneId"].of(ids[_name]));
|
|
1032
|
+
return position + _name.length;
|
|
1033
|
+
}
|
|
1157
1034
|
}
|
|
1158
|
-
|
|
1035
|
+
|
|
1036
|
+
return ~position;
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
_proto.toString = function toString() {
|
|
1040
|
+
return "ZoneText(" + this._textStyle + ")";
|
|
1041
|
+
};
|
|
1159
1042
|
|
|
1160
1043
|
return CldrZoneTextPrinterParser;
|
|
1161
1044
|
}();
|
|
@@ -1176,12 +1059,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1176
1059
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LocalizedOffsetPrinterParser; });
|
|
1177
1060
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
1178
1061
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
1179
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1180
|
-
|
|
1181
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1182
|
-
|
|
1183
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
1184
|
-
|
|
1185
1062
|
/**
|
|
1186
1063
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
1187
1064
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -1192,180 +1069,174 @@ var MathUtil = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].MathUtil;
|
|
|
1192
1069
|
|
|
1193
1070
|
var LocalizedOffsetPrinterParser = function () {
|
|
1194
1071
|
function LocalizedOffsetPrinterParser(textStyle) {
|
|
1195
|
-
_classCallCheck(this, LocalizedOffsetPrinterParser);
|
|
1196
|
-
|
|
1197
1072
|
this._textStyle = textStyle;
|
|
1198
1073
|
}
|
|
1199
1074
|
|
|
1200
|
-
|
|
1201
|
-
key: "textStyle",
|
|
1202
|
-
value: function textStyle() {
|
|
1203
|
-
return this._textStyle;
|
|
1204
|
-
}
|
|
1205
|
-
}, {
|
|
1206
|
-
key: "print",
|
|
1207
|
-
value: function print(context, buf) {
|
|
1208
|
-
var offsetSecs = context.getValue(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS);
|
|
1075
|
+
var _proto = LocalizedOffsetPrinterParser.prototype;
|
|
1209
1076
|
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1077
|
+
_proto.textStyle = function textStyle() {
|
|
1078
|
+
return this._textStyle;
|
|
1079
|
+
};
|
|
1213
1080
|
|
|
1214
|
-
|
|
1081
|
+
_proto.print = function print(context, buf) {
|
|
1082
|
+
var offsetSecs = context.getValue(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS);
|
|
1215
1083
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1084
|
+
if (offsetSecs == null) {
|
|
1085
|
+
return false;
|
|
1086
|
+
}
|
|
1219
1087
|
|
|
1220
|
-
|
|
1088
|
+
buf.append('GMT');
|
|
1221
1089
|
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
var absSeconds = Math.abs(MathUtil.intMod(totalSecs, 60));
|
|
1226
|
-
buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
|
|
1090
|
+
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
1091
|
+
return new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
|
|
1092
|
+
}
|
|
1227
1093
|
|
|
1228
|
-
|
|
1229
|
-
buf.append(':').append(MathUtil.intDiv(absMinutes, 10)).append(MathUtil.intMod(absMinutes, 10));
|
|
1094
|
+
var totalSecs = MathUtil.safeToInt(offsetSecs);
|
|
1230
1095
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1096
|
+
if (totalSecs !== 0) {
|
|
1097
|
+
var absHours = Math.abs(MathUtil.intMod(MathUtil.intDiv(totalSecs, 3600), 100));
|
|
1098
|
+
var absMinutes = Math.abs(MathUtil.intMod(MathUtil.intDiv(totalSecs, 60), 60));
|
|
1099
|
+
var absSeconds = Math.abs(MathUtil.intMod(totalSecs, 60));
|
|
1100
|
+
buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
|
|
1101
|
+
|
|
1102
|
+
if (absMinutes > 0 || absSeconds > 0) {
|
|
1103
|
+
buf.append(':').append(MathUtil.intDiv(absMinutes, 10)).append(MathUtil.intMod(absMinutes, 10));
|
|
1104
|
+
|
|
1105
|
+
if (absSeconds > 0) {
|
|
1106
|
+
buf.append(':').append(MathUtil.intDiv(absSeconds, 10)).append(MathUtil.intMod(absSeconds, 10));
|
|
1234
1107
|
}
|
|
1235
1108
|
}
|
|
1236
|
-
|
|
1237
|
-
return true;
|
|
1238
1109
|
}
|
|
1239
|
-
}, {
|
|
1240
|
-
key: "parse",
|
|
1241
|
-
value: function parse(context, text, position) {
|
|
1242
|
-
if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
|
|
1243
|
-
return ~position;
|
|
1244
|
-
}
|
|
1245
1110
|
|
|
1246
|
-
|
|
1111
|
+
return true;
|
|
1112
|
+
};
|
|
1247
1113
|
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1114
|
+
_proto.parse = function parse(context, text, position) {
|
|
1115
|
+
if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
|
|
1116
|
+
return ~position;
|
|
1117
|
+
}
|
|
1251
1118
|
|
|
1252
|
-
|
|
1119
|
+
position += 3;
|
|
1253
1120
|
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1121
|
+
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
1122
|
+
return new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
|
|
1123
|
+
}
|
|
1257
1124
|
|
|
1258
|
-
|
|
1125
|
+
var end = text.length;
|
|
1259
1126
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1127
|
+
if (position === end) {
|
|
1128
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, 0, position, position);
|
|
1129
|
+
}
|
|
1263
1130
|
|
|
1264
|
-
|
|
1131
|
+
var sign = text.charAt(position);
|
|
1265
1132
|
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1133
|
+
if (sign !== '+' && sign !== '-') {
|
|
1134
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, 0, position, position);
|
|
1135
|
+
}
|
|
1269
1136
|
|
|
1270
|
-
|
|
1271
|
-
var ch = text.charAt(position);
|
|
1137
|
+
var negative = sign === '-' ? -1 : 1;
|
|
1272
1138
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1139
|
+
if (position === end) {
|
|
1140
|
+
return ~position;
|
|
1141
|
+
}
|
|
1276
1142
|
|
|
1277
|
-
|
|
1278
|
-
|
|
1143
|
+
position++;
|
|
1144
|
+
var ch = text.charAt(position);
|
|
1279
1145
|
|
|
1280
|
-
|
|
1281
|
-
|
|
1146
|
+
if (ch < '0' || ch > '9') {
|
|
1147
|
+
return ~position;
|
|
1148
|
+
}
|
|
1282
1149
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1150
|
+
position++;
|
|
1151
|
+
var hour = MathUtil.parseInt(ch);
|
|
1285
1152
|
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
}
|
|
1153
|
+
if (position !== end) {
|
|
1154
|
+
ch = text.charAt(position);
|
|
1289
1155
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
}
|
|
1156
|
+
if (ch >= '0' && ch <= '9') {
|
|
1157
|
+
hour = hour * 10 + MathUtil.parseInt(ch);
|
|
1293
1158
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1159
|
+
if (hour > 23) {
|
|
1160
|
+
return ~position;
|
|
1161
|
+
}
|
|
1296
1162
|
|
|
1297
|
-
|
|
1163
|
+
position++;
|
|
1298
1164
|
}
|
|
1165
|
+
}
|
|
1299
1166
|
|
|
1300
|
-
|
|
1167
|
+
if (position === end || text.charAt(position) !== ':') {
|
|
1168
|
+
var _offset = negative * 3600 * hour;
|
|
1301
1169
|
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
}
|
|
1170
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, _offset, position, position);
|
|
1171
|
+
}
|
|
1305
1172
|
|
|
1306
|
-
|
|
1173
|
+
position++;
|
|
1307
1174
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1175
|
+
if (position > end - 2) {
|
|
1176
|
+
return ~position;
|
|
1177
|
+
}
|
|
1311
1178
|
|
|
1312
|
-
|
|
1313
|
-
var min = MathUtil.parseInt(ch);
|
|
1314
|
-
ch = text.charAt(position);
|
|
1179
|
+
ch = text.charAt(position);
|
|
1315
1180
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1181
|
+
if (ch < '0' || ch > '9') {
|
|
1182
|
+
return ~position;
|
|
1183
|
+
}
|
|
1319
1184
|
|
|
1320
|
-
|
|
1321
|
-
|
|
1185
|
+
position++;
|
|
1186
|
+
var min = MathUtil.parseInt(ch);
|
|
1187
|
+
ch = text.charAt(position);
|
|
1322
1188
|
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1189
|
+
if (ch < '0' || ch > '9') {
|
|
1190
|
+
return ~position;
|
|
1191
|
+
}
|
|
1326
1192
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1193
|
+
position++;
|
|
1194
|
+
min = min * 10 + MathUtil.parseInt(ch);
|
|
1329
1195
|
|
|
1330
|
-
|
|
1331
|
-
|
|
1196
|
+
if (min > 59) {
|
|
1197
|
+
return ~position;
|
|
1198
|
+
}
|
|
1332
1199
|
|
|
1333
|
-
|
|
1200
|
+
if (position === end || text.charAt(position) !== ':') {
|
|
1201
|
+
var _offset2 = negative * (3600 * hour + 60 * min);
|
|
1334
1202
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
}
|
|
1203
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, _offset2, position, position);
|
|
1204
|
+
}
|
|
1338
1205
|
|
|
1339
|
-
|
|
1206
|
+
position++;
|
|
1340
1207
|
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1208
|
+
if (position > end - 2) {
|
|
1209
|
+
return ~position;
|
|
1210
|
+
}
|
|
1344
1211
|
|
|
1345
|
-
|
|
1346
|
-
var sec = MathUtil.parseInt(ch);
|
|
1347
|
-
ch = text.charAt(position);
|
|
1212
|
+
ch = text.charAt(position);
|
|
1348
1213
|
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1214
|
+
if (ch < '0' || ch > '9') {
|
|
1215
|
+
return ~position;
|
|
1216
|
+
}
|
|
1352
1217
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1218
|
+
position++;
|
|
1219
|
+
var sec = MathUtil.parseInt(ch);
|
|
1220
|
+
ch = text.charAt(position);
|
|
1355
1221
|
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
var offset = negative * (3600 * hour + 60 * min + sec);
|
|
1361
|
-
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, offset, position, position);
|
|
1222
|
+
if (ch < '0' || ch > '9') {
|
|
1223
|
+
return ~position;
|
|
1362
1224
|
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1225
|
+
|
|
1226
|
+
position++;
|
|
1227
|
+
sec = sec * 10 + MathUtil.parseInt(ch);
|
|
1228
|
+
|
|
1229
|
+
if (sec > 59) {
|
|
1230
|
+
return ~position;
|
|
1367
1231
|
}
|
|
1368
|
-
|
|
1232
|
+
|
|
1233
|
+
var offset = negative * (3600 * hour + 60 * min + sec);
|
|
1234
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, offset, position, position);
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
_proto.toString = function toString() {
|
|
1238
|
+
return "LocalizedOffset(" + this._textStyle + ")";
|
|
1239
|
+
};
|
|
1369
1240
|
|
|
1370
1241
|
return LocalizedOffsetPrinterParser;
|
|
1371
1242
|
}();
|
|
@@ -1386,18 +1257,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1386
1257
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextPrinterParser; });
|
|
1387
1258
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
1388
1259
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
1389
|
-
function
|
|
1260
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1390
1261
|
|
|
1391
1262
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1392
1263
|
|
|
1393
1264
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
1394
1265
|
|
|
1395
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1396
|
-
|
|
1397
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1398
|
-
|
|
1399
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
1400
|
-
|
|
1401
1266
|
/**
|
|
1402
1267
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
1403
1268
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -1407,104 +1272,86 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
1407
1272
|
|
|
1408
1273
|
var TextPrinterParser = function () {
|
|
1409
1274
|
function TextPrinterParser(field, textStyle, provider) {
|
|
1410
|
-
_classCallCheck(this, TextPrinterParser);
|
|
1411
|
-
|
|
1412
1275
|
this._field = field;
|
|
1413
1276
|
this._textStyle = textStyle;
|
|
1414
1277
|
this._provider = provider;
|
|
1415
1278
|
}
|
|
1416
1279
|
|
|
1417
|
-
|
|
1418
|
-
key: "field",
|
|
1419
|
-
value: function field() {
|
|
1420
|
-
return this._field;
|
|
1421
|
-
}
|
|
1422
|
-
}, {
|
|
1423
|
-
key: "textStyle",
|
|
1424
|
-
value: function textStyle() {
|
|
1425
|
-
return this._textStyle;
|
|
1426
|
-
}
|
|
1427
|
-
}, {
|
|
1428
|
-
key: "provider",
|
|
1429
|
-
value: function provider() {
|
|
1430
|
-
return this._provider;
|
|
1431
|
-
}
|
|
1432
|
-
}, {
|
|
1433
|
-
key: "print",
|
|
1434
|
-
value: function print(context, buf) {
|
|
1435
|
-
var value = context.getValue(this._field);
|
|
1280
|
+
var _proto = TextPrinterParser.prototype;
|
|
1436
1281
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1282
|
+
_proto.field = function field() {
|
|
1283
|
+
return this._field;
|
|
1284
|
+
};
|
|
1440
1285
|
|
|
1441
|
-
|
|
1286
|
+
_proto.textStyle = function textStyle() {
|
|
1287
|
+
return this._textStyle;
|
|
1288
|
+
};
|
|
1442
1289
|
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1290
|
+
_proto.provider = function provider() {
|
|
1291
|
+
return this._provider;
|
|
1292
|
+
};
|
|
1446
1293
|
|
|
1447
|
-
|
|
1448
|
-
|
|
1294
|
+
_proto.print = function print(context, buf) {
|
|
1295
|
+
var value = context.getValue(this._field);
|
|
1296
|
+
|
|
1297
|
+
if (value === null) {
|
|
1298
|
+
return false;
|
|
1449
1299
|
}
|
|
1450
|
-
}, {
|
|
1451
|
-
key: "parse",
|
|
1452
|
-
value: function parse(context, parseText, position) {
|
|
1453
|
-
var length = parseText.length;
|
|
1454
1300
|
|
|
1455
|
-
|
|
1456
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]("The position is invalid: ".concat(position));
|
|
1457
|
-
}
|
|
1301
|
+
var text = this._provider.getText(this._field, value, this._textStyle, context.locale());
|
|
1458
1302
|
|
|
1459
|
-
|
|
1303
|
+
if (text === null) {
|
|
1304
|
+
return this._numberPrinterParser().print(context, buf);
|
|
1305
|
+
}
|
|
1460
1306
|
|
|
1461
|
-
|
|
1307
|
+
buf.append(text);
|
|
1308
|
+
return true;
|
|
1309
|
+
};
|
|
1462
1310
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
_step;
|
|
1311
|
+
_proto.parse = function parse(context, parseText, position) {
|
|
1312
|
+
var length = parseText.length;
|
|
1466
1313
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
var itText = entry.key;
|
|
1314
|
+
if (position < 0 || position > length) {
|
|
1315
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]("The position is invalid: " + position);
|
|
1316
|
+
}
|
|
1471
1317
|
|
|
1472
|
-
|
|
1473
|
-
return context.setParsedField(this._field, entry.value, position, position + itText.length);
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
} catch (err) {
|
|
1477
|
-
_iterator.e(err);
|
|
1478
|
-
} finally {
|
|
1479
|
-
_iterator.f();
|
|
1480
|
-
}
|
|
1318
|
+
var style = context.isStrict() ? this._textStyle : null;
|
|
1481
1319
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1320
|
+
var it = this._provider.getTextIterator(this._field, style, context.locale());
|
|
1321
|
+
|
|
1322
|
+
if (it != null) {
|
|
1323
|
+
for (var _iterator = _createForOfIteratorHelperLoose(it), _step; !(_step = _iterator()).done;) {
|
|
1324
|
+
var entry = _step.value;
|
|
1325
|
+
var itText = entry.key;
|
|
1326
|
+
|
|
1327
|
+
if (context.subSequenceEquals(itText, 0, parseText, position, itText.length)) {
|
|
1328
|
+
return context.setParsedField(this._field, entry.value, position, position + itText.length);
|
|
1484
1329
|
}
|
|
1485
1330
|
}
|
|
1486
1331
|
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
}, {
|
|
1490
|
-
key: "_numberPrinterParser",
|
|
1491
|
-
value: function _numberPrinterParser() {
|
|
1492
|
-
if (this._currentNumberPrinterParser == null) {
|
|
1493
|
-
this._currentNumberPrinterParser = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(this._field, 1, 19, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NORMAL);
|
|
1332
|
+
if (context.isStrict()) {
|
|
1333
|
+
return ~position;
|
|
1494
1334
|
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
return this._numberPrinterParser().parse(context, parseText, position);
|
|
1338
|
+
};
|
|
1495
1339
|
|
|
1496
|
-
|
|
1340
|
+
_proto._numberPrinterParser = function _numberPrinterParser() {
|
|
1341
|
+
if (this._currentNumberPrinterParser == null) {
|
|
1342
|
+
this._currentNumberPrinterParser = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(this._field, 1, 19, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NORMAL);
|
|
1497
1343
|
}
|
|
1498
|
-
}, {
|
|
1499
|
-
key: "toString",
|
|
1500
|
-
value: function toString() {
|
|
1501
|
-
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
1502
|
-
return "Text(".concat(this._field, ")");
|
|
1503
|
-
}
|
|
1504
1344
|
|
|
1505
|
-
|
|
1345
|
+
return this._currentNumberPrinterParser;
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
_proto.toString = function toString() {
|
|
1349
|
+
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
1350
|
+
return "Text(" + this._field + ")";
|
|
1506
1351
|
}
|
|
1507
|
-
|
|
1352
|
+
|
|
1353
|
+
return "Text(" + this._field + "," + this._textStyle + ")";
|
|
1354
|
+
};
|
|
1508
1355
|
|
|
1509
1356
|
return TextPrinterParser;
|
|
1510
1357
|
}();
|
|
@@ -1526,12 +1373,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1526
1373
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
1527
1374
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
1528
1375
|
/* harmony import */ var _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../temporal/WeekFields */ "./src/temporal/WeekFields.js");
|
|
1529
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1530
|
-
|
|
1531
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1532
|
-
|
|
1533
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
1534
|
-
|
|
1535
1376
|
/*
|
|
1536
1377
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
1537
1378
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -1542,95 +1383,89 @@ var StringBuilder = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].StringBuilde
|
|
|
1542
1383
|
|
|
1543
1384
|
var WeekFieldsPrinterParser = function () {
|
|
1544
1385
|
function WeekFieldsPrinterParser(letter, count) {
|
|
1545
|
-
_classCallCheck(this, WeekFieldsPrinterParser);
|
|
1546
|
-
|
|
1547
1386
|
this._letter = letter;
|
|
1548
1387
|
this._count = count;
|
|
1549
1388
|
}
|
|
1550
1389
|
|
|
1551
|
-
|
|
1552
|
-
key: "print",
|
|
1553
|
-
value: function print(context, buf) {
|
|
1554
|
-
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
1390
|
+
var _proto = WeekFieldsPrinterParser.prototype;
|
|
1555
1391
|
|
|
1556
|
-
|
|
1392
|
+
_proto.print = function print(context, buf) {
|
|
1393
|
+
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
1557
1394
|
|
|
1558
|
-
|
|
1559
|
-
}
|
|
1560
|
-
}, {
|
|
1561
|
-
key: "parse",
|
|
1562
|
-
value: function parse(context, text, position) {
|
|
1563
|
-
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
1395
|
+
var pp = this._evaluate(weekFields);
|
|
1564
1396
|
|
|
1565
|
-
|
|
1397
|
+
return pp.print(context, buf);
|
|
1398
|
+
};
|
|
1566
1399
|
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
}, {
|
|
1570
|
-
key: "_evaluate",
|
|
1571
|
-
value: function _evaluate(weekFields) {
|
|
1572
|
-
var pp = null;
|
|
1400
|
+
_proto.parse = function parse(context, text, position) {
|
|
1401
|
+
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
1573
1402
|
|
|
1574
|
-
|
|
1575
|
-
case 'e':
|
|
1576
|
-
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NOT_NEGATIVE);
|
|
1577
|
-
break;
|
|
1403
|
+
var pp = this._evaluate(weekFields);
|
|
1578
1404
|
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
break;
|
|
1405
|
+
return pp.parse(context, text, position);
|
|
1406
|
+
};
|
|
1582
1407
|
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
break;
|
|
1408
|
+
_proto._evaluate = function _evaluate(weekFields) {
|
|
1409
|
+
var pp = null;
|
|
1586
1410
|
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1411
|
+
switch (this._letter) {
|
|
1412
|
+
case 'e':
|
|
1413
|
+
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NOT_NEGATIVE);
|
|
1414
|
+
break;
|
|
1590
1415
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
} else {
|
|
1595
|
-
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NORMAL : _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].EXCEEDS_PAD, -1);
|
|
1596
|
-
}
|
|
1416
|
+
case 'c':
|
|
1417
|
+
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NOT_NEGATIVE);
|
|
1418
|
+
break;
|
|
1597
1419
|
|
|
1598
|
-
|
|
1599
|
-
|
|
1420
|
+
case 'w':
|
|
1421
|
+
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.weekOfWeekBasedYear(), this._count, 2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NOT_NEGATIVE);
|
|
1422
|
+
break;
|
|
1600
1423
|
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
key: "toString",
|
|
1605
|
-
value: function toString() {
|
|
1606
|
-
var sb = new StringBuilder(30);
|
|
1607
|
-
sb.append('Localized(');
|
|
1424
|
+
case 'W':
|
|
1425
|
+
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.weekOfMonth(), 1, 2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NOT_NEGATIVE);
|
|
1426
|
+
break;
|
|
1608
1427
|
|
|
1609
|
-
|
|
1610
|
-
if (this._count ===
|
|
1611
|
-
|
|
1612
|
-
} else if (this._count === 2) {
|
|
1613
|
-
sb.append('ReducedValue(WeekBasedYear,2,2,2000-01-01)');
|
|
1428
|
+
case 'Y':
|
|
1429
|
+
if (this._count === 2) {
|
|
1430
|
+
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].ReducedPrinterParser(weekFields.weekBasedYear(), 2, 2, 0, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].ReducedPrinterParser.BASE_DATE);
|
|
1614
1431
|
} else {
|
|
1615
|
-
|
|
1616
|
-
}
|
|
1617
|
-
} else {
|
|
1618
|
-
if (this._letter === 'c' || this._letter === 'e') {
|
|
1619
|
-
sb.append('DayOfWeek');
|
|
1620
|
-
} else if (this._letter === 'w') {
|
|
1621
|
-
sb.append('WeekOfWeekBasedYear');
|
|
1622
|
-
} else if (this._letter === 'W') {
|
|
1623
|
-
sb.append('WeekOfMonth');
|
|
1432
|
+
pp = new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NORMAL : _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].EXCEEDS_PAD, -1);
|
|
1624
1433
|
}
|
|
1625
1434
|
|
|
1626
|
-
|
|
1627
|
-
|
|
1435
|
+
break;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
return pp;
|
|
1439
|
+
};
|
|
1440
|
+
|
|
1441
|
+
_proto.toString = function toString() {
|
|
1442
|
+
var sb = new StringBuilder(30);
|
|
1443
|
+
sb.append('Localized(');
|
|
1444
|
+
|
|
1445
|
+
if (this._letter === 'Y') {
|
|
1446
|
+
if (this._count === 1) {
|
|
1447
|
+
sb.append('WeekBasedYear');
|
|
1448
|
+
} else if (this._count === 2) {
|
|
1449
|
+
sb.append('ReducedValue(WeekBasedYear,2,2,2000-01-01)');
|
|
1450
|
+
} else {
|
|
1451
|
+
sb.append('WeekBasedYear,').append(this._count).append(',').append(19).append(',').append(this._count < 4 ? _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].NORMAL : _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["SignStyle"].EXCEEDS_PAD);
|
|
1452
|
+
}
|
|
1453
|
+
} else {
|
|
1454
|
+
if (this._letter === 'c' || this._letter === 'e') {
|
|
1455
|
+
sb.append('DayOfWeek');
|
|
1456
|
+
} else if (this._letter === 'w') {
|
|
1457
|
+
sb.append('WeekOfWeekBasedYear');
|
|
1458
|
+
} else if (this._letter === 'W') {
|
|
1459
|
+
sb.append('WeekOfMonth');
|
|
1628
1460
|
}
|
|
1629
1461
|
|
|
1630
|
-
sb.append('
|
|
1631
|
-
|
|
1462
|
+
sb.append(',');
|
|
1463
|
+
sb.append(this._count);
|
|
1632
1464
|
}
|
|
1633
|
-
|
|
1465
|
+
|
|
1466
|
+
sb.append(')');
|
|
1467
|
+
return sb.toString();
|
|
1468
|
+
};
|
|
1634
1469
|
|
|
1635
1470
|
return WeekFieldsPrinterParser;
|
|
1636
1471
|
}();
|
|
@@ -1719,12 +1554,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1719
1554
|
/* harmony import */ var cldr_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cldr_data__WEBPACK_IMPORTED_MODULE_1__);
|
|
1720
1555
|
/* harmony import */ var cldrjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! cldrjs */ "cldrjs");
|
|
1721
1556
|
/* harmony import */ var cldrjs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(cldrjs__WEBPACK_IMPORTED_MODULE_2__);
|
|
1722
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1723
|
-
|
|
1724
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1725
|
-
|
|
1726
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
1727
|
-
|
|
1728
1557
|
/*
|
|
1729
1558
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
1730
1559
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -1751,9 +1580,27 @@ var _weekDayMap = {
|
|
|
1751
1580
|
'sun': _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"].SUNDAY
|
|
1752
1581
|
};
|
|
1753
1582
|
var ComputedDayOfField = function () {
|
|
1754
|
-
function
|
|
1755
|
-
|
|
1583
|
+
ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
|
|
1584
|
+
return new ComputedDayOfField('DayOfWeek', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, DAY_OF_WEEK_RANGE);
|
|
1585
|
+
};
|
|
1756
1586
|
|
|
1587
|
+
ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
|
|
1588
|
+
return new ComputedDayOfField('WeekOfMonth', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS, WEEK_OF_MONTH_RANGE);
|
|
1589
|
+
};
|
|
1590
|
+
|
|
1591
|
+
ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
|
|
1592
|
+
return new ComputedDayOfField('WeekOfYear', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS, WEEK_OF_YEAR_RANGE);
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
|
|
1596
|
+
return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
|
|
1600
|
+
return new ComputedDayOfField('WeekBasedYear', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER, WEEK_BASED_YEAR_RANGE);
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
|
|
1757
1604
|
this._name = name;
|
|
1758
1605
|
this._weekDef = weekDef;
|
|
1759
1606
|
this._baseUnit = baseUnit;
|
|
@@ -1761,484 +1608,482 @@ var ComputedDayOfField = function () {
|
|
|
1761
1608
|
this._range = range;
|
|
1762
1609
|
}
|
|
1763
1610
|
|
|
1764
|
-
|
|
1765
|
-
key: "getFrom",
|
|
1766
|
-
value: function getFrom(temporal) {
|
|
1767
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1768
|
-
|
|
1769
|
-
var dow = this._localizedDayOfWeek(temporal, sow);
|
|
1770
|
-
|
|
1771
|
-
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
1772
|
-
return dow;
|
|
1773
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
1774
|
-
return this._localizedWeekOfMonth(temporal, dow);
|
|
1775
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
1776
|
-
return this._localizedWeekOfYear(temporal, dow);
|
|
1777
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
1778
|
-
return this._localizedWOWBY(temporal);
|
|
1779
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
1780
|
-
return this._localizedWBY(temporal);
|
|
1781
|
-
} else {
|
|
1782
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
}, {
|
|
1786
|
-
key: "_localizedDayOfWeek",
|
|
1787
|
-
value: function _localizedDayOfWeek(temporal, sow) {
|
|
1788
|
-
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1789
|
-
return MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1790
|
-
}
|
|
1791
|
-
}, {
|
|
1792
|
-
key: "_localizedWeekOfMonth",
|
|
1793
|
-
value: function _localizedWeekOfMonth(temporal, dow) {
|
|
1794
|
-
var dom = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
1795
|
-
|
|
1796
|
-
var offset = this._startOfWeekOffset(dom, dow);
|
|
1611
|
+
var _proto = ComputedDayOfField.prototype;
|
|
1797
1612
|
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
}, {
|
|
1801
|
-
key: "_localizedWeekOfYear",
|
|
1802
|
-
value: function _localizedWeekOfYear(temporal, dow) {
|
|
1803
|
-
var doy = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
1613
|
+
_proto.getFrom = function getFrom(temporal) {
|
|
1614
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1804
1615
|
|
|
1805
|
-
|
|
1616
|
+
var dow = this._localizedDayOfWeek(temporal, sow);
|
|
1806
1617
|
|
|
1807
|
-
|
|
1618
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
1619
|
+
return dow;
|
|
1620
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
1621
|
+
return this._localizedWeekOfMonth(temporal, dow);
|
|
1622
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
1623
|
+
return this._localizedWeekOfYear(temporal, dow);
|
|
1624
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
1625
|
+
return this._localizedWOWBY(temporal);
|
|
1626
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
1627
|
+
return this._localizedWBY(temporal);
|
|
1628
|
+
} else {
|
|
1629
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
1808
1630
|
}
|
|
1809
|
-
}
|
|
1810
|
-
key: "_localizedWOWBY",
|
|
1811
|
-
value: function _localizedWOWBY(temporal) {
|
|
1812
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1631
|
+
};
|
|
1813
1632
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1633
|
+
_proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
|
|
1634
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1635
|
+
return MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1636
|
+
};
|
|
1816
1637
|
|
|
1817
|
-
|
|
1638
|
+
_proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
|
|
1639
|
+
var dom = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
1818
1640
|
|
|
1819
|
-
|
|
1820
|
-
var previous = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].from(temporal).minus(1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1821
|
-
return this._localizedWeekOfYear(previous, dow) + 1;
|
|
1822
|
-
} else if (woy >= 53) {
|
|
1823
|
-
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
1641
|
+
var offset = this._startOfWeekOffset(dom, dow);
|
|
1824
1642
|
|
|
1825
|
-
|
|
1826
|
-
|
|
1643
|
+
return ComputedDayOfField._computeWeek(offset, dom);
|
|
1644
|
+
};
|
|
1827
1645
|
|
|
1828
|
-
|
|
1646
|
+
_proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
|
|
1647
|
+
var doy = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
1829
1648
|
|
|
1830
|
-
|
|
1831
|
-
return woy - (weekIndexOfFirstWeekNextYear - 1);
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1649
|
+
var offset = this._startOfWeekOffset(doy, dow);
|
|
1834
1650
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
}, {
|
|
1838
|
-
key: "_localizedWBY",
|
|
1839
|
-
value: function _localizedWBY(temporal) {
|
|
1840
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1651
|
+
return ComputedDayOfField._computeWeek(offset, doy);
|
|
1652
|
+
};
|
|
1841
1653
|
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
1654
|
+
_proto._localizedWOWBY = function _localizedWOWBY(temporal) {
|
|
1655
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1845
1656
|
|
|
1846
|
-
|
|
1657
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1658
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1847
1659
|
|
|
1848
|
-
|
|
1849
|
-
return year - 1;
|
|
1850
|
-
} else if (woy < 53) {
|
|
1851
|
-
return year;
|
|
1852
|
-
}
|
|
1660
|
+
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
1853
1661
|
|
|
1662
|
+
if (woy === 0) {
|
|
1663
|
+
var previous = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].from(temporal).minus(1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1664
|
+
return this._localizedWeekOfYear(previous, dow) + 1;
|
|
1665
|
+
} else if (woy >= 53) {
|
|
1854
1666
|
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
1855
1667
|
|
|
1668
|
+
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
1856
1669
|
var yearLen = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Year"].isLeap(year) ? 366 : 365;
|
|
1857
1670
|
|
|
1858
1671
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
1859
1672
|
|
|
1860
1673
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
1861
|
-
return
|
|
1674
|
+
return woy - (weekIndexOfFirstWeekNextYear - 1);
|
|
1862
1675
|
}
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
return woy;
|
|
1679
|
+
};
|
|
1680
|
+
|
|
1681
|
+
_proto._localizedWBY = function _localizedWBY(temporal) {
|
|
1682
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1683
|
+
|
|
1684
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1685
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1686
|
+
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
1863
1687
|
|
|
1688
|
+
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
1689
|
+
|
|
1690
|
+
if (woy === 0) {
|
|
1691
|
+
return year - 1;
|
|
1692
|
+
} else if (woy < 53) {
|
|
1864
1693
|
return year;
|
|
1865
1694
|
}
|
|
1866
|
-
}, {
|
|
1867
|
-
key: "_startOfWeekOffset",
|
|
1868
|
-
value: function _startOfWeekOffset(day, dow) {
|
|
1869
|
-
var weekStart = MathUtil.floorMod(day - dow, 7);
|
|
1870
|
-
var offset = -weekStart;
|
|
1871
1695
|
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1696
|
+
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
1697
|
+
|
|
1698
|
+
var yearLen = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Year"].isLeap(year) ? 366 : 365;
|
|
1699
|
+
|
|
1700
|
+
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
1875
1701
|
|
|
1876
|
-
|
|
1702
|
+
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
1703
|
+
return year + 1;
|
|
1877
1704
|
}
|
|
1878
|
-
}, {
|
|
1879
|
-
key: "adjustInto",
|
|
1880
|
-
value: function adjustInto(temporal, newValue) {
|
|
1881
|
-
var newVal = this._range.checkValidIntValue(newValue, this);
|
|
1882
1705
|
|
|
1883
|
-
|
|
1706
|
+
return year;
|
|
1707
|
+
};
|
|
1884
1708
|
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1709
|
+
_proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
|
|
1710
|
+
var weekStart = MathUtil.floorMod(day - dow, 7);
|
|
1711
|
+
var offset = -weekStart;
|
|
1888
1712
|
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
var result = temporal.plus(diffWeeks, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1713
|
+
if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
|
|
1714
|
+
offset = 7 - weekStart;
|
|
1715
|
+
}
|
|
1893
1716
|
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
result = result.minus(newWowby, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1897
|
-
} else {
|
|
1898
|
-
if (result.get(this) < newVal) {
|
|
1899
|
-
result = result.plus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1900
|
-
}
|
|
1717
|
+
return offset;
|
|
1718
|
+
};
|
|
1901
1719
|
|
|
1902
|
-
|
|
1720
|
+
ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
|
|
1721
|
+
return MathUtil.intDiv(7 + offset + (day - 1), 7);
|
|
1722
|
+
};
|
|
1903
1723
|
|
|
1904
|
-
|
|
1724
|
+
_proto.adjustInto = function adjustInto(temporal, newValue) {
|
|
1725
|
+
var newVal = this._range.checkValidIntValue(newValue, this);
|
|
1905
1726
|
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1727
|
+
var currentVal = temporal.get(this);
|
|
1728
|
+
|
|
1729
|
+
if (newVal === currentVal) {
|
|
1730
|
+
return temporal;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
1734
|
+
var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
|
|
1735
|
+
var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
|
|
1736
|
+
var result = temporal.plus(diffWeeks, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1737
|
+
|
|
1738
|
+
if (result.get(this) > newVal) {
|
|
1739
|
+
var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
1740
|
+
result = result.minus(newWowby, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1741
|
+
} else {
|
|
1742
|
+
if (result.get(this) < newVal) {
|
|
1743
|
+
result = result.plus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1909
1744
|
}
|
|
1910
1745
|
|
|
1911
|
-
|
|
1746
|
+
var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
1747
|
+
|
|
1748
|
+
result = result.plus(baseWowby - _newWowby, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1749
|
+
|
|
1750
|
+
if (result.get(this) > newVal) {
|
|
1751
|
+
result = result.minus(1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
1752
|
+
}
|
|
1912
1753
|
}
|
|
1913
1754
|
|
|
1914
|
-
|
|
1915
|
-
return temporal.plus(delta, this._baseUnit);
|
|
1755
|
+
return result;
|
|
1916
1756
|
}
|
|
1917
|
-
}, {
|
|
1918
|
-
key: "resolve",
|
|
1919
|
-
value: function resolve(fieldValues, partialTemporal, resolverStyle) {
|
|
1920
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1921
1757
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1758
|
+
var delta = newVal - currentVal;
|
|
1759
|
+
return temporal.plus(delta, this._baseUnit);
|
|
1760
|
+
};
|
|
1924
1761
|
|
|
1925
|
-
|
|
1762
|
+
_proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
|
|
1763
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
1926
1764
|
|
|
1927
|
-
|
|
1765
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
1766
|
+
var value = fieldValues.remove(this);
|
|
1928
1767
|
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1768
|
+
var localDow = this._range.checkValidIntValue(value, this);
|
|
1769
|
+
|
|
1770
|
+
var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
|
|
1932
1771
|
|
|
1933
|
-
|
|
1772
|
+
fieldValues.put(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK, _isoDow);
|
|
1773
|
+
return null;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK) === false) {
|
|
1777
|
+
return null;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
1781
|
+
if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
|
|
1934
1782
|
return null;
|
|
1935
1783
|
}
|
|
1936
1784
|
|
|
1937
|
-
|
|
1938
|
-
if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
|
|
1939
|
-
return null;
|
|
1940
|
-
}
|
|
1785
|
+
var _isoDow2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK));
|
|
1941
1786
|
|
|
1942
|
-
|
|
1787
|
+
var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
|
|
1943
1788
|
|
|
1944
|
-
|
|
1789
|
+
var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
|
|
1790
|
+
var date;
|
|
1791
|
+
var days;
|
|
1945
1792
|
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
var
|
|
1793
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].LENIENT) {
|
|
1794
|
+
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
1795
|
+
var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
|
|
1949
1796
|
|
|
1950
|
-
|
|
1951
|
-
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
1952
|
-
var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
|
|
1797
|
+
var dateDow = this._localizedDayOfWeek(date, sow);
|
|
1953
1798
|
|
|
1954
|
-
|
|
1799
|
+
var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
|
|
1955
1800
|
|
|
1956
|
-
|
|
1801
|
+
days = weeks * 7 + (_dow - dateDow);
|
|
1802
|
+
} else {
|
|
1803
|
+
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
1957
1804
|
|
|
1958
|
-
|
|
1959
|
-
} else {
|
|
1960
|
-
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
1805
|
+
var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
|
|
1961
1806
|
|
|
1962
|
-
|
|
1807
|
+
var _dateDow = this._localizedDayOfWeek(date, sow);
|
|
1963
1808
|
|
|
1964
|
-
|
|
1809
|
+
var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
|
|
1965
1810
|
|
|
1966
|
-
|
|
1811
|
+
days = _weeks * 7 + (_dow - _dateDow);
|
|
1812
|
+
}
|
|
1967
1813
|
|
|
1968
|
-
|
|
1814
|
+
date = date.plus(days, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS);
|
|
1815
|
+
|
|
1816
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].STRICT) {
|
|
1817
|
+
if (date.getLong(this) !== fieldValues.get(this)) {
|
|
1818
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different year');
|
|
1969
1819
|
}
|
|
1820
|
+
}
|
|
1970
1821
|
|
|
1971
|
-
|
|
1822
|
+
fieldValues.remove(this);
|
|
1823
|
+
fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
|
|
1824
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1825
|
+
return date;
|
|
1826
|
+
}
|
|
1972
1827
|
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1828
|
+
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR) === false) {
|
|
1829
|
+
return null;
|
|
1830
|
+
}
|
|
1978
1831
|
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
return date;
|
|
1983
|
-
}
|
|
1832
|
+
var isoDow = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK));
|
|
1833
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1834
|
+
var year = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR));
|
|
1984
1835
|
|
|
1985
|
-
|
|
1836
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
1837
|
+
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) === false) {
|
|
1986
1838
|
return null;
|
|
1987
1839
|
}
|
|
1988
1840
|
|
|
1989
|
-
var
|
|
1990
|
-
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1991
|
-
var year = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR));
|
|
1841
|
+
var _value = fieldValues.remove(this);
|
|
1992
1842
|
|
|
1993
|
-
|
|
1994
|
-
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) === false) {
|
|
1995
|
-
return null;
|
|
1996
|
-
}
|
|
1843
|
+
var _date;
|
|
1997
1844
|
|
|
1998
|
-
|
|
1845
|
+
var _days;
|
|
1999
1846
|
|
|
2000
|
-
|
|
1847
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].LENIENT) {
|
|
1848
|
+
var month = fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
1849
|
+
_date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, 1, 1);
|
|
1850
|
+
_date = _date.plus(month - 1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS);
|
|
2001
1851
|
|
|
2002
|
-
var
|
|
1852
|
+
var _dateDow2 = this._localizedDayOfWeek(_date, sow);
|
|
2003
1853
|
|
|
2004
|
-
|
|
2005
|
-
var month = fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
2006
|
-
_date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, 1, 1);
|
|
2007
|
-
_date = _date.plus(month - 1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS);
|
|
1854
|
+
var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
|
|
2008
1855
|
|
|
2009
|
-
|
|
1856
|
+
_days = _weeks2 * 7 + (dow - _dateDow2);
|
|
1857
|
+
} else {
|
|
1858
|
+
var _month = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR));
|
|
2010
1859
|
|
|
2011
|
-
|
|
1860
|
+
_date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, _month, 8);
|
|
2012
1861
|
|
|
2013
|
-
|
|
2014
|
-
} else {
|
|
2015
|
-
var _month = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR));
|
|
1862
|
+
var _dateDow3 = this._localizedDayOfWeek(_date, sow);
|
|
2016
1863
|
|
|
2017
|
-
|
|
1864
|
+
var wom = this._range.checkValidIntValue(_value, this);
|
|
2018
1865
|
|
|
2019
|
-
|
|
1866
|
+
var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
|
|
2020
1867
|
|
|
2021
|
-
|
|
1868
|
+
_days = _weeks3 * 7 + (dow - _dateDow3);
|
|
1869
|
+
}
|
|
2022
1870
|
|
|
2023
|
-
|
|
1871
|
+
_date = _date.plus(_days, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS);
|
|
2024
1872
|
|
|
2025
|
-
|
|
1873
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].STRICT) {
|
|
1874
|
+
if (_date.getLong(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) !== fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR)) {
|
|
1875
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different month');
|
|
2026
1876
|
}
|
|
1877
|
+
}
|
|
2027
1878
|
|
|
2028
|
-
|
|
1879
|
+
fieldValues.remove(this);
|
|
1880
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
1881
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
1882
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1883
|
+
return _date;
|
|
1884
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
1885
|
+
var _value2 = fieldValues.remove(this);
|
|
2029
1886
|
|
|
2030
|
-
|
|
2031
|
-
if (_date.getLong(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) !== fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR)) {
|
|
2032
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different month');
|
|
2033
|
-
}
|
|
2034
|
-
}
|
|
1887
|
+
var _date2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, 1, 1);
|
|
2035
1888
|
|
|
2036
|
-
|
|
2037
|
-
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
2038
|
-
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
2039
|
-
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
2040
|
-
return _date;
|
|
2041
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
2042
|
-
var _value2 = fieldValues.remove(this);
|
|
1889
|
+
var _days2;
|
|
2043
1890
|
|
|
2044
|
-
|
|
1891
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].LENIENT) {
|
|
1892
|
+
var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
|
|
2045
1893
|
|
|
2046
|
-
var
|
|
1894
|
+
var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
|
|
2047
1895
|
|
|
2048
|
-
|
|
2049
|
-
|
|
1896
|
+
_days2 = _weeks4 * 7 + (dow - _dateDow4);
|
|
1897
|
+
} else {
|
|
1898
|
+
var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
|
|
2050
1899
|
|
|
2051
|
-
|
|
1900
|
+
var woy = this._range.checkValidIntValue(_value2, this);
|
|
2052
1901
|
|
|
2053
|
-
|
|
2054
|
-
} else {
|
|
2055
|
-
var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
|
|
1902
|
+
var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
|
|
2056
1903
|
|
|
2057
|
-
|
|
1904
|
+
_days2 = _weeks5 * 7 + (dow - _dateDow5);
|
|
1905
|
+
}
|
|
2058
1906
|
|
|
2059
|
-
|
|
1907
|
+
_date2 = _date2.plus(_days2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS);
|
|
2060
1908
|
|
|
2061
|
-
|
|
1909
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].STRICT) {
|
|
1910
|
+
if (_date2.getLong(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR) !== fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR)) {
|
|
1911
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different year');
|
|
2062
1912
|
}
|
|
1913
|
+
}
|
|
2063
1914
|
|
|
2064
|
-
|
|
1915
|
+
fieldValues.remove(this);
|
|
1916
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
1917
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1918
|
+
return _date2;
|
|
1919
|
+
} else {
|
|
1920
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
1921
|
+
}
|
|
1922
|
+
};
|
|
2065
1923
|
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
1924
|
+
_proto.name = function name() {
|
|
1925
|
+
return this._name;
|
|
1926
|
+
};
|
|
2071
1927
|
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
return _date2;
|
|
2076
|
-
} else {
|
|
2077
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
}, {
|
|
2081
|
-
key: "name",
|
|
2082
|
-
value: function name() {
|
|
2083
|
-
return this._name;
|
|
2084
|
-
}
|
|
2085
|
-
}, {
|
|
2086
|
-
key: "baseUnit",
|
|
2087
|
-
value: function baseUnit() {
|
|
2088
|
-
return this._baseUnit;
|
|
2089
|
-
}
|
|
2090
|
-
}, {
|
|
2091
|
-
key: "rangeUnit",
|
|
2092
|
-
value: function rangeUnit() {
|
|
2093
|
-
return this._rangeUnit;
|
|
2094
|
-
}
|
|
2095
|
-
}, {
|
|
2096
|
-
key: "range",
|
|
2097
|
-
value: function range() {
|
|
2098
|
-
return this._range;
|
|
2099
|
-
}
|
|
2100
|
-
}, {
|
|
2101
|
-
key: "isDateBased",
|
|
2102
|
-
value: function isDateBased() {
|
|
2103
|
-
return true;
|
|
2104
|
-
}
|
|
2105
|
-
}, {
|
|
2106
|
-
key: "isTimeBased",
|
|
2107
|
-
value: function isTimeBased() {
|
|
2108
|
-
return false;
|
|
2109
|
-
}
|
|
2110
|
-
}, {
|
|
2111
|
-
key: "isSupportedBy",
|
|
2112
|
-
value: function isSupportedBy(temporal) {
|
|
2113
|
-
if (temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK)) {
|
|
2114
|
-
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
2115
|
-
return true;
|
|
2116
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
2117
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
2118
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
2119
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
2120
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
2121
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
2122
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
2123
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
1928
|
+
_proto.baseUnit = function baseUnit() {
|
|
1929
|
+
return this._baseUnit;
|
|
1930
|
+
};
|
|
2126
1931
|
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
1932
|
+
_proto.rangeUnit = function rangeUnit() {
|
|
1933
|
+
return this._rangeUnit;
|
|
1934
|
+
};
|
|
1935
|
+
|
|
1936
|
+
_proto.range = function range() {
|
|
1937
|
+
return this._range;
|
|
1938
|
+
};
|
|
1939
|
+
|
|
1940
|
+
_proto.isDateBased = function isDateBased() {
|
|
1941
|
+
return true;
|
|
1942
|
+
};
|
|
2135
1943
|
|
|
2136
|
-
|
|
1944
|
+
_proto.isTimeBased = function isTimeBased() {
|
|
1945
|
+
return false;
|
|
1946
|
+
};
|
|
2137
1947
|
|
|
2138
|
-
|
|
2139
|
-
|
|
1948
|
+
_proto.isSupportedBy = function isSupportedBy(temporal) {
|
|
1949
|
+
if (temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK)) {
|
|
1950
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
1951
|
+
return true;
|
|
1952
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
1953
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
2140
1954
|
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
2141
|
-
|
|
1955
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
2142
1956
|
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
2143
|
-
return
|
|
1957
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
2144
1958
|
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
2145
|
-
return temporal.
|
|
2146
|
-
} else {
|
|
2147
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
1959
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
2148
1960
|
}
|
|
1961
|
+
}
|
|
2149
1962
|
|
|
2150
|
-
|
|
1963
|
+
return false;
|
|
1964
|
+
};
|
|
2151
1965
|
|
|
2152
|
-
|
|
2153
|
-
|
|
1966
|
+
_proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
|
|
1967
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
1968
|
+
return this._range;
|
|
1969
|
+
}
|
|
2154
1970
|
|
|
2155
|
-
|
|
1971
|
+
var field = null;
|
|
2156
1972
|
|
|
2157
|
-
|
|
2158
|
-
|
|
1973
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
1974
|
+
field = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH;
|
|
1975
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
1976
|
+
field = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR;
|
|
1977
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
1978
|
+
return this._rangeWOWBY(temporal);
|
|
1979
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
1980
|
+
return temporal.range(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
1981
|
+
} else {
|
|
1982
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
2159
1983
|
}
|
|
2160
|
-
}, {
|
|
2161
|
-
key: "_rangeWOWBY",
|
|
2162
|
-
value: function _rangeWOWBY(temporal) {
|
|
2163
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
2164
1984
|
|
|
2165
|
-
|
|
2166
|
-
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
1985
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
2167
1986
|
|
|
2168
|
-
|
|
1987
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
1988
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
2169
1989
|
|
|
2170
|
-
|
|
2171
|
-
return this._rangeWOWBY(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoChronology"].INSTANCE.date(temporal).minus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS));
|
|
2172
|
-
}
|
|
1990
|
+
var offset = this._startOfWeekOffset(temporal.get(field), dow);
|
|
2173
1991
|
|
|
2174
|
-
|
|
1992
|
+
var fieldRange = temporal.range(field);
|
|
1993
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ValueRange"].of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
|
|
1994
|
+
};
|
|
2175
1995
|
|
|
2176
|
-
|
|
2177
|
-
|
|
1996
|
+
_proto._rangeWOWBY = function _rangeWOWBY(temporal) {
|
|
1997
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
2178
1998
|
|
|
2179
|
-
|
|
1999
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
2000
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
2180
2001
|
|
|
2181
|
-
|
|
2182
|
-
return this._rangeWOWBY(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoChronology"].INSTANCE.date(temporal).plus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS));
|
|
2183
|
-
}
|
|
2002
|
+
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
2184
2003
|
|
|
2185
|
-
|
|
2004
|
+
if (woy === 0) {
|
|
2005
|
+
return this._rangeWOWBY(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoChronology"].INSTANCE.date(temporal).minus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS));
|
|
2186
2006
|
}
|
|
2187
|
-
}, {
|
|
2188
|
-
key: "displayName",
|
|
2189
|
-
value: function displayName(locale) {
|
|
2190
|
-
requireNonNull(locale, 'locale');
|
|
2191
2007
|
|
|
2192
|
-
|
|
2193
|
-
return 'Week';
|
|
2194
|
-
}
|
|
2008
|
+
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
2195
2009
|
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
}], [{
|
|
2204
|
-
key: "ofDayOfWeekField",
|
|
2205
|
-
value: function ofDayOfWeekField(weekDef) {
|
|
2206
|
-
return new ComputedDayOfField('DayOfWeek', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, DAY_OF_WEEK_RANGE);
|
|
2207
|
-
}
|
|
2208
|
-
}, {
|
|
2209
|
-
key: "ofWeekOfMonthField",
|
|
2210
|
-
value: function ofWeekOfMonthField(weekDef) {
|
|
2211
|
-
return new ComputedDayOfField('WeekOfMonth', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS, WEEK_OF_MONTH_RANGE);
|
|
2212
|
-
}
|
|
2213
|
-
}, {
|
|
2214
|
-
key: "ofWeekOfYearField",
|
|
2215
|
-
value: function ofWeekOfYearField(weekDef) {
|
|
2216
|
-
return new ComputedDayOfField('WeekOfYear', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS, WEEK_OF_YEAR_RANGE);
|
|
2217
|
-
}
|
|
2218
|
-
}, {
|
|
2219
|
-
key: "ofWeekOfWeekBasedYearField",
|
|
2220
|
-
value: function ofWeekOfWeekBasedYearField(weekDef) {
|
|
2221
|
-
return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
|
|
2222
|
-
}
|
|
2223
|
-
}, {
|
|
2224
|
-
key: "ofWeekBasedYearField",
|
|
2225
|
-
value: function ofWeekBasedYearField(weekDef) {
|
|
2226
|
-
return new ComputedDayOfField('WeekBasedYear', weekDef, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER, WEEK_BASED_YEAR_RANGE);
|
|
2010
|
+
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
2011
|
+
var yearLen = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Year"].isLeap(year) ? 366 : 365;
|
|
2012
|
+
|
|
2013
|
+
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
2014
|
+
|
|
2015
|
+
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
2016
|
+
return this._rangeWOWBY(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoChronology"].INSTANCE.date(temporal).plus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS));
|
|
2227
2017
|
}
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2018
|
+
|
|
2019
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ValueRange"].of(1, weekIndexOfFirstWeekNextYear - 1);
|
|
2020
|
+
};
|
|
2021
|
+
|
|
2022
|
+
_proto.displayName = function displayName(locale) {
|
|
2023
|
+
requireNonNull(locale, 'locale');
|
|
2024
|
+
|
|
2025
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
2026
|
+
return 'Week';
|
|
2232
2027
|
}
|
|
2233
|
-
|
|
2028
|
+
|
|
2029
|
+
return this.toString();
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
_proto.toString = function toString() {
|
|
2033
|
+
return this._name + "[" + this._weekDef.toString() + "]";
|
|
2034
|
+
};
|
|
2234
2035
|
|
|
2235
2036
|
return ComputedDayOfField;
|
|
2236
2037
|
}();
|
|
2237
2038
|
var WeekFieldsCache = new Map();
|
|
2238
2039
|
var WeekFields = function () {
|
|
2239
|
-
function
|
|
2240
|
-
|
|
2040
|
+
WeekFields.of = function of(firstDayOrLocale, minDays) {
|
|
2041
|
+
if (minDays === undefined) {
|
|
2042
|
+
return WeekFields.ofLocale(firstDayOrLocale);
|
|
2043
|
+
} else {
|
|
2044
|
+
return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
|
|
2045
|
+
}
|
|
2046
|
+
};
|
|
2047
|
+
|
|
2048
|
+
WeekFields.ofLocale = function ofLocale(locale) {
|
|
2049
|
+
requireNonNull(locale, 'locale');
|
|
2050
|
+
cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a.load(cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('supplemental/weekData.json'));
|
|
2051
|
+
var cldr = new cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a(locale.localeString());
|
|
2052
|
+
var worldRegion = '001';
|
|
2053
|
+
var weekData = cldr.get('supplemental/weekData');
|
|
2054
|
+
|
|
2055
|
+
var dow = _weekDayMap[weekData.firstDay[locale.country()]];
|
|
2056
|
+
|
|
2057
|
+
if (!dow) {
|
|
2058
|
+
dow = _weekDayMap[weekData.firstDay[worldRegion]];
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
var minDays = weekData.minDays[locale.country()];
|
|
2062
|
+
|
|
2063
|
+
if (!minDays) {
|
|
2064
|
+
minDays = weekData.minDays[worldRegion];
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
|
|
2068
|
+
};
|
|
2241
2069
|
|
|
2070
|
+
WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
2071
|
+
requireNonNull(firstDayOfWeek, 'firstDayOfWeek');
|
|
2072
|
+
requireInstance(firstDayOfWeek, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"], 'firstDayOfWeek');
|
|
2073
|
+
requireNonNull(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
2074
|
+
var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
|
|
2075
|
+
var rules = WeekFieldsCache.get(key);
|
|
2076
|
+
|
|
2077
|
+
if (rules == null) {
|
|
2078
|
+
rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
|
|
2079
|
+
WeekFieldsCache.set(key, rules);
|
|
2080
|
+
rules = WeekFieldsCache.get(key);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
return rules;
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
2242
2087
|
requireNonNull(firstDayOfWeek, 'firstDayOfWeek');
|
|
2243
2088
|
requireInstance(firstDayOfWeek, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"], 'firstDayOfWeek');
|
|
2244
2089
|
requireNonNull(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
@@ -2257,114 +2102,55 @@ var WeekFields = function () {
|
|
|
2257
2102
|
cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a.load(cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('supplemental/likelySubtags.json'));
|
|
2258
2103
|
}
|
|
2259
2104
|
|
|
2260
|
-
|
|
2261
|
-
key: "firstDayOfWeek",
|
|
2262
|
-
value: function firstDayOfWeek() {
|
|
2263
|
-
return this._firstDayOfWeek;
|
|
2264
|
-
}
|
|
2265
|
-
}, {
|
|
2266
|
-
key: "minimalDaysInFirstWeek",
|
|
2267
|
-
value: function minimalDaysInFirstWeek() {
|
|
2268
|
-
return this._minimalDays;
|
|
2269
|
-
}
|
|
2270
|
-
}, {
|
|
2271
|
-
key: "dayOfWeek",
|
|
2272
|
-
value: function dayOfWeek() {
|
|
2273
|
-
return this._dayOfWeek;
|
|
2274
|
-
}
|
|
2275
|
-
}, {
|
|
2276
|
-
key: "weekOfMonth",
|
|
2277
|
-
value: function weekOfMonth() {
|
|
2278
|
-
return this._weekOfMonth;
|
|
2279
|
-
}
|
|
2280
|
-
}, {
|
|
2281
|
-
key: "weekOfYear",
|
|
2282
|
-
value: function weekOfYear() {
|
|
2283
|
-
return this._weekOfYear;
|
|
2284
|
-
}
|
|
2285
|
-
}, {
|
|
2286
|
-
key: "weekOfWeekBasedYear",
|
|
2287
|
-
value: function weekOfWeekBasedYear() {
|
|
2288
|
-
return this._weekOfWeekBasedYear;
|
|
2289
|
-
}
|
|
2290
|
-
}, {
|
|
2291
|
-
key: "weekBasedYear",
|
|
2292
|
-
value: function weekBasedYear() {
|
|
2293
|
-
return this._weekBasedYear;
|
|
2294
|
-
}
|
|
2295
|
-
}, {
|
|
2296
|
-
key: "equals",
|
|
2297
|
-
value: function equals(other) {
|
|
2298
|
-
if (this === other) {
|
|
2299
|
-
return true;
|
|
2300
|
-
}
|
|
2105
|
+
var _proto2 = WeekFields.prototype;
|
|
2301
2106
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2107
|
+
_proto2.firstDayOfWeek = function firstDayOfWeek() {
|
|
2108
|
+
return this._firstDayOfWeek;
|
|
2109
|
+
};
|
|
2305
2110
|
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
}
|
|
2309
|
-
key: "hashCode",
|
|
2310
|
-
value: function hashCode() {
|
|
2311
|
-
return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
|
|
2312
|
-
}
|
|
2313
|
-
}, {
|
|
2314
|
-
key: "toString",
|
|
2315
|
-
value: function toString() {
|
|
2316
|
-
return "WeekFields[".concat(this._firstDayOfWeek, ",").concat(this._minimalDays, "]");
|
|
2317
|
-
}
|
|
2318
|
-
}], [{
|
|
2319
|
-
key: "of",
|
|
2320
|
-
value: function of(firstDayOrLocale, minDays) {
|
|
2321
|
-
if (minDays === undefined) {
|
|
2322
|
-
return WeekFields.ofLocale(firstDayOrLocale);
|
|
2323
|
-
} else {
|
|
2324
|
-
return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
}, {
|
|
2328
|
-
key: "ofLocale",
|
|
2329
|
-
value: function ofLocale(locale) {
|
|
2330
|
-
requireNonNull(locale, 'locale');
|
|
2331
|
-
cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a.load(cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('supplemental/weekData.json'));
|
|
2332
|
-
var cldr = new cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a(locale.localeString());
|
|
2333
|
-
var worldRegion = '001';
|
|
2334
|
-
var weekData = cldr.get('supplemental/weekData');
|
|
2111
|
+
_proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
|
|
2112
|
+
return this._minimalDays;
|
|
2113
|
+
};
|
|
2335
2114
|
|
|
2336
|
-
|
|
2115
|
+
_proto2.dayOfWeek = function dayOfWeek() {
|
|
2116
|
+
return this._dayOfWeek;
|
|
2117
|
+
};
|
|
2337
2118
|
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2119
|
+
_proto2.weekOfMonth = function weekOfMonth() {
|
|
2120
|
+
return this._weekOfMonth;
|
|
2121
|
+
};
|
|
2341
2122
|
|
|
2342
|
-
|
|
2123
|
+
_proto2.weekOfYear = function weekOfYear() {
|
|
2124
|
+
return this._weekOfYear;
|
|
2125
|
+
};
|
|
2343
2126
|
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2127
|
+
_proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
|
|
2128
|
+
return this._weekOfWeekBasedYear;
|
|
2129
|
+
};
|
|
2347
2130
|
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
}
|
|
2351
|
-
key: "ofFirstDayOfWeekMinDays",
|
|
2352
|
-
value: function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
2353
|
-
requireNonNull(firstDayOfWeek, 'firstDayOfWeek');
|
|
2354
|
-
requireInstance(firstDayOfWeek, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"], 'firstDayOfWeek');
|
|
2355
|
-
requireNonNull(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
2356
|
-
var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
|
|
2357
|
-
var rules = WeekFieldsCache.get(key);
|
|
2358
|
-
|
|
2359
|
-
if (rules == null) {
|
|
2360
|
-
rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
|
|
2361
|
-
WeekFieldsCache.set(key, rules);
|
|
2362
|
-
rules = WeekFieldsCache.get(key);
|
|
2363
|
-
}
|
|
2131
|
+
_proto2.weekBasedYear = function weekBasedYear() {
|
|
2132
|
+
return this._weekBasedYear;
|
|
2133
|
+
};
|
|
2364
2134
|
|
|
2365
|
-
|
|
2135
|
+
_proto2.equals = function equals(other) {
|
|
2136
|
+
if (this === other) {
|
|
2137
|
+
return true;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
if (other instanceof WeekFields) {
|
|
2141
|
+
return this.hashCode() === other.hashCode();
|
|
2366
2142
|
}
|
|
2367
|
-
|
|
2143
|
+
|
|
2144
|
+
return false;
|
|
2145
|
+
};
|
|
2146
|
+
|
|
2147
|
+
_proto2.hashCode = function hashCode() {
|
|
2148
|
+
return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
|
|
2149
|
+
};
|
|
2150
|
+
|
|
2151
|
+
_proto2.toString = function toString() {
|
|
2152
|
+
return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
|
|
2153
|
+
};
|
|
2368
2154
|
|
|
2369
2155
|
return WeekFields;
|
|
2370
2156
|
}();
|