@js-joda/locale_zh 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/dist/index.js +1092 -1306
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.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)
|
|
@@ -1987,12 +1987,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1987
1987
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Locale; });
|
|
1988
1988
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_init", function() { return _init; });
|
|
1989
1989
|
/* harmony import */ var _format_cldr_CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format/cldr/CldrDateTimeTextProvider */ "./src/format/cldr/CldrDateTimeTextProvider.js");
|
|
1990
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1991
|
-
|
|
1992
|
-
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); } }
|
|
1993
|
-
|
|
1994
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
1995
|
-
|
|
1996
1990
|
/*
|
|
1997
1991
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
1998
1992
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -2000,64 +1994,61 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
2000
1994
|
|
|
2001
1995
|
|
|
2002
1996
|
var Locale = function () {
|
|
2003
|
-
function
|
|
2004
|
-
|
|
2005
|
-
|
|
1997
|
+
Locale.getAvailableLocales = function getAvailableLocales() {
|
|
1998
|
+
return new _format_cldr_CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_0__["default"]().getAvailableLocales();
|
|
1999
|
+
};
|
|
2006
2000
|
|
|
2007
|
-
|
|
2001
|
+
function Locale(language, country, localeString) {
|
|
2002
|
+
if (country === void 0) {
|
|
2003
|
+
country = '';
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
if (localeString === void 0) {
|
|
2007
|
+
localeString = '';
|
|
2008
|
+
}
|
|
2008
2009
|
|
|
2009
2010
|
this._language = language;
|
|
2010
2011
|
this._country = country;
|
|
2011
2012
|
this._localeString = localeString;
|
|
2012
2013
|
}
|
|
2013
2014
|
|
|
2014
|
-
|
|
2015
|
-
key: "language",
|
|
2016
|
-
value: function language() {
|
|
2017
|
-
return this._language;
|
|
2018
|
-
}
|
|
2019
|
-
}, {
|
|
2020
|
-
key: "country",
|
|
2021
|
-
value: function country() {
|
|
2022
|
-
return this._country;
|
|
2023
|
-
}
|
|
2024
|
-
}, {
|
|
2025
|
-
key: "localeString",
|
|
2026
|
-
value: function localeString() {
|
|
2027
|
-
if (this._localeString.length > 0) {
|
|
2028
|
-
return this._localeString;
|
|
2029
|
-
}
|
|
2015
|
+
var _proto = Locale.prototype;
|
|
2030
2016
|
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2017
|
+
_proto.language = function language() {
|
|
2018
|
+
return this._language;
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
_proto.country = function country() {
|
|
2022
|
+
return this._country;
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
_proto.localeString = function localeString() {
|
|
2026
|
+
if (this._localeString.length > 0) {
|
|
2027
|
+
return this._localeString;
|
|
2036
2028
|
}
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2029
|
+
|
|
2030
|
+
if (this._country.length > 0) {
|
|
2031
|
+
return this._language + "-" + this._country;
|
|
2032
|
+
} else {
|
|
2033
|
+
return this._language;
|
|
2041
2034
|
}
|
|
2042
|
-
}
|
|
2043
|
-
key: "equals",
|
|
2044
|
-
value: function equals(other) {
|
|
2045
|
-
if (!other) {
|
|
2046
|
-
return false;
|
|
2047
|
-
}
|
|
2035
|
+
};
|
|
2048
2036
|
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2037
|
+
_proto.toString = function toString() {
|
|
2038
|
+
return "Locale[" + this.localeString() + "]";
|
|
2039
|
+
};
|
|
2052
2040
|
|
|
2053
|
-
|
|
2041
|
+
_proto.equals = function equals(other) {
|
|
2042
|
+
if (!other) {
|
|
2043
|
+
return false;
|
|
2054
2044
|
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
return new _format_cldr_CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_0__["default"]().getAvailableLocales();
|
|
2045
|
+
|
|
2046
|
+
if (!(other instanceof Locale)) {
|
|
2047
|
+
return false;
|
|
2059
2048
|
}
|
|
2060
|
-
|
|
2049
|
+
|
|
2050
|
+
return this.localeString() === other.localeString();
|
|
2051
|
+
};
|
|
2061
2052
|
|
|
2062
2053
|
return Locale;
|
|
2063
2054
|
}();
|
|
@@ -2138,28 +2129,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2138
2129
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
2139
2130
|
/* harmony import */ var _Locale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Locale */ "./src/Locale.js");
|
|
2140
2131
|
/* harmony import */ var _cldr_CldrDateTimeFormatterBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cldr/CldrDateTimeFormatterBuilder */ "./src/format/cldr/CldrDateTimeFormatterBuilder.js");
|
|
2141
|
-
function
|
|
2142
|
-
|
|
2143
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2144
|
-
|
|
2145
|
-
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); } }
|
|
2146
|
-
|
|
2147
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
2148
|
-
|
|
2149
|
-
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); }
|
|
2132
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
2150
2133
|
|
|
2151
2134
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
2152
2135
|
|
|
2153
|
-
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); }; }
|
|
2154
|
-
|
|
2155
|
-
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); }
|
|
2156
|
-
|
|
2157
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2158
|
-
|
|
2159
|
-
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; } }
|
|
2160
|
-
|
|
2161
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2162
|
-
|
|
2163
2136
|
/*
|
|
2164
2137
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
2165
2138
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -2170,28 +2143,23 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
2170
2143
|
var requireNonNull = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].assert.requireNonNull;
|
|
2171
2144
|
|
|
2172
2145
|
var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
var _super = _createSuper(LocaleDateTimeFormatter);
|
|
2146
|
+
_inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
|
|
2176
2147
|
|
|
2177
2148
|
function LocaleDateTimeFormatter() {
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
return _super.apply(this, arguments);
|
|
2149
|
+
return _DateTimeFormatter.apply(this, arguments) || this;
|
|
2181
2150
|
}
|
|
2182
2151
|
|
|
2183
|
-
|
|
2184
|
-
key: "withLocale",
|
|
2185
|
-
value: function withLocale(locale) {
|
|
2186
|
-
requireNonNull(locale, 'locale');
|
|
2152
|
+
var _proto = LocaleDateTimeFormatter.prototype;
|
|
2187
2153
|
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
}
|
|
2154
|
+
_proto.withLocale = function withLocale(locale) {
|
|
2155
|
+
requireNonNull(locale, 'locale');
|
|
2191
2156
|
|
|
2192
|
-
|
|
2157
|
+
if (locale.equals(this._locale)) {
|
|
2158
|
+
return this;
|
|
2193
2159
|
}
|
|
2194
|
-
|
|
2160
|
+
|
|
2161
|
+
return new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatter"](this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
|
|
2162
|
+
};
|
|
2195
2163
|
|
|
2196
2164
|
return LocaleDateTimeFormatter;
|
|
2197
2165
|
}(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatter"]);
|
|
@@ -2237,12 +2205,6 @@ function _init() {
|
|
|
2237
2205
|
__webpack_require__.r(__webpack_exports__);
|
|
2238
2206
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEntry", function() { return createEntry; });
|
|
2239
2207
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocaleStore", function() { return LocaleStore; });
|
|
2240
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2241
|
-
|
|
2242
|
-
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); } }
|
|
2243
|
-
|
|
2244
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
2245
|
-
|
|
2246
2208
|
/*
|
|
2247
2209
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
2248
2210
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -2252,7 +2214,7 @@ var createEntry = function createEntry(text, field) {
|
|
|
2252
2214
|
key: text,
|
|
2253
2215
|
value: field,
|
|
2254
2216
|
toString: function toString() {
|
|
2255
|
-
return
|
|
2217
|
+
return text + "->" + field;
|
|
2256
2218
|
}
|
|
2257
2219
|
};
|
|
2258
2220
|
};
|
|
@@ -2263,8 +2225,6 @@ var _comparator = function _comparator(obj1, obj2) {
|
|
|
2263
2225
|
|
|
2264
2226
|
var LocaleStore = function () {
|
|
2265
2227
|
function LocaleStore(valueTextMap) {
|
|
2266
|
-
_classCallCheck(this, LocaleStore);
|
|
2267
|
-
|
|
2268
2228
|
this._valueTextMap = valueTextMap;
|
|
2269
2229
|
var map = {};
|
|
2270
2230
|
var allList = [];
|
|
@@ -2288,19 +2248,17 @@ var LocaleStore = function () {
|
|
|
2288
2248
|
this._parsable = map;
|
|
2289
2249
|
}
|
|
2290
2250
|
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
}
|
|
2303
|
-
}]);
|
|
2251
|
+
var _proto = LocaleStore.prototype;
|
|
2252
|
+
|
|
2253
|
+
_proto.getText = function getText(value, style) {
|
|
2254
|
+
var map = this._valueTextMap[style];
|
|
2255
|
+
return map != null ? map[value] : null;
|
|
2256
|
+
};
|
|
2257
|
+
|
|
2258
|
+
_proto.getTextIterator = function getTextIterator(style) {
|
|
2259
|
+
var list = this._parsable[style];
|
|
2260
|
+
return list != null ? list[Symbol.iterator]() : null;
|
|
2261
|
+
};
|
|
2304
2262
|
|
|
2305
2263
|
return LocaleStore;
|
|
2306
2264
|
}();
|
|
@@ -2383,28 +2341,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2383
2341
|
/* harmony import */ var _LocaleStore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../LocaleStore */ "./src/format/LocaleStore.js");
|
|
2384
2342
|
/* harmony import */ var _parser_LocalizedOffsetPrinterParser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../parser/LocalizedOffsetPrinterParser */ "./src/format/parser/LocalizedOffsetPrinterParser.js");
|
|
2385
2343
|
/* harmony import */ var _parser_WeekFieldsPrinterParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../parser/WeekFieldsPrinterParser */ "./src/format/parser/WeekFieldsPrinterParser.js");
|
|
2386
|
-
function
|
|
2387
|
-
|
|
2388
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2389
|
-
|
|
2390
|
-
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); } }
|
|
2391
|
-
|
|
2392
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
2393
|
-
|
|
2394
|
-
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); }
|
|
2344
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
2395
2345
|
|
|
2396
2346
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
2397
2347
|
|
|
2398
|
-
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); }; }
|
|
2399
|
-
|
|
2400
|
-
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); }
|
|
2401
|
-
|
|
2402
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
2403
|
-
|
|
2404
|
-
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; } }
|
|
2405
|
-
|
|
2406
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2407
|
-
|
|
2408
2348
|
/**
|
|
2409
2349
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
2410
2350
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -2422,98 +2362,87 @@ var _jodaInternal$assert = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].asser
|
|
|
2422
2362
|
requireInstance = _jodaInternal$assert.requireInstance;
|
|
2423
2363
|
|
|
2424
2364
|
var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
var _super = _createSuper(CldrDateTimeFormatterBuilder);
|
|
2365
|
+
_inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
|
|
2428
2366
|
|
|
2429
2367
|
function CldrDateTimeFormatterBuilder() {
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
return _super.apply(this, arguments);
|
|
2368
|
+
return _DateTimeFormatterBui.apply(this, arguments) || this;
|
|
2433
2369
|
}
|
|
2434
2370
|
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
}
|
|
2445
|
-
}
|
|
2446
|
-
}, {
|
|
2447
|
-
key: "appendTextField",
|
|
2448
|
-
value: function appendTextField(field) {
|
|
2449
|
-
return this.appendTextFieldStyle(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL);
|
|
2371
|
+
var _proto = CldrDateTimeFormatterBuilder.prototype;
|
|
2372
|
+
|
|
2373
|
+
_proto.appendText = function appendText(field, styleOrMap) {
|
|
2374
|
+
if (styleOrMap === undefined) {
|
|
2375
|
+
return this.appendTextField(field);
|
|
2376
|
+
} else if (styleOrMap instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"]) {
|
|
2377
|
+
return this.appendTextFieldStyle(field, styleOrMap);
|
|
2378
|
+
} else {
|
|
2379
|
+
return this.appendTextFieldMap(field, styleOrMap);
|
|
2450
2380
|
}
|
|
2451
|
-
}
|
|
2452
|
-
key: "appendTextFieldStyle",
|
|
2453
|
-
value: function appendTextFieldStyle(field, textStyle) {
|
|
2454
|
-
requireNonNull(field, 'field');
|
|
2455
|
-
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalField"], 'field');
|
|
2456
|
-
requireNonNull(textStyle, 'textStyle');
|
|
2457
|
-
requireInstance(textStyle, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"], 'textStyle');
|
|
2381
|
+
};
|
|
2458
2382
|
|
|
2459
|
-
|
|
2383
|
+
_proto.appendTextField = function appendTextField(field) {
|
|
2384
|
+
return this.appendTextFieldStyle(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL);
|
|
2385
|
+
};
|
|
2460
2386
|
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
requireNonNull(field, 'field');
|
|
2467
|
-
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"], 'field');
|
|
2468
|
-
requireNonNull(textLookup, 'textLookup');
|
|
2469
|
-
var copy = Object.assign({}, textLookup);
|
|
2470
|
-
var map = {};
|
|
2471
|
-
map[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = copy;
|
|
2472
|
-
var store = new _LocaleStore__WEBPACK_IMPORTED_MODULE_4__["LocaleStore"](map);
|
|
2473
|
-
var provider = {
|
|
2474
|
-
getText: function getText(field, value, style) {
|
|
2475
|
-
return store.getText(value, style);
|
|
2476
|
-
},
|
|
2477
|
-
getTextIterator: function getTextIterator(field, style) {
|
|
2478
|
-
return store.getTextIterator(style);
|
|
2479
|
-
}
|
|
2480
|
-
};
|
|
2387
|
+
_proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
|
|
2388
|
+
requireNonNull(field, 'field');
|
|
2389
|
+
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalField"], 'field');
|
|
2390
|
+
requireNonNull(textStyle, 'textStyle');
|
|
2391
|
+
requireInstance(textStyle, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"], 'textStyle');
|
|
2481
2392
|
|
|
2482
|
-
|
|
2393
|
+
this._appendInternal(new _parser_TextPrinterParser__WEBPACK_IMPORTED_MODULE_1__["default"](field, textStyle, new _CldrDateTimeTextProvider__WEBPACK_IMPORTED_MODULE_2__["default"]()));
|
|
2483
2394
|
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2395
|
+
return this;
|
|
2396
|
+
};
|
|
2397
|
+
|
|
2398
|
+
_proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
|
|
2399
|
+
requireNonNull(field, 'field');
|
|
2400
|
+
requireInstance(field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"], 'field');
|
|
2401
|
+
requireNonNull(textLookup, 'textLookup');
|
|
2402
|
+
var copy = Object.assign({}, textLookup);
|
|
2403
|
+
var map = {};
|
|
2404
|
+
map[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = copy;
|
|
2405
|
+
var store = new _LocaleStore__WEBPACK_IMPORTED_MODULE_4__["LocaleStore"](map);
|
|
2406
|
+
var provider = {
|
|
2407
|
+
getText: function getText(field, value, style) {
|
|
2408
|
+
return store.getText(value, style);
|
|
2409
|
+
},
|
|
2410
|
+
getTextIterator: function getTextIterator(field, style) {
|
|
2411
|
+
return store.getTextIterator(style);
|
|
2412
|
+
}
|
|
2413
|
+
};
|
|
2491
2414
|
|
|
2492
|
-
|
|
2415
|
+
this._appendInternal(new _parser_TextPrinterParser__WEBPACK_IMPORTED_MODULE_1__["default"](field, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL, provider));
|
|
2493
2416
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
}, {
|
|
2497
|
-
key: "appendZoneText",
|
|
2498
|
-
value: function appendZoneText(textStyle) {
|
|
2499
|
-
this._appendInternal(new _CldrZoneTextPrinterParser__WEBPACK_IMPORTED_MODULE_3__["default"](textStyle));
|
|
2417
|
+
return this;
|
|
2418
|
+
};
|
|
2500
2419
|
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
key: "appendLocalizedOffset",
|
|
2505
|
-
value: function appendLocalizedOffset(textStyle) {
|
|
2506
|
-
requireNonNull(textStyle, 'textStyle');
|
|
2420
|
+
_proto.appendWeekField = function appendWeekField(field, count) {
|
|
2421
|
+
requireNonNull(field, 'field');
|
|
2422
|
+
requireNonNull(count, 'count');
|
|
2507
2423
|
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2424
|
+
this._appendInternal(new _parser_WeekFieldsPrinterParser__WEBPACK_IMPORTED_MODULE_6__["default"](field, count));
|
|
2425
|
+
|
|
2426
|
+
return this;
|
|
2427
|
+
};
|
|
2511
2428
|
|
|
2512
|
-
|
|
2429
|
+
_proto.appendZoneText = function appendZoneText(textStyle) {
|
|
2430
|
+
this._appendInternal(new _CldrZoneTextPrinterParser__WEBPACK_IMPORTED_MODULE_3__["default"](textStyle));
|
|
2513
2431
|
|
|
2514
|
-
|
|
2432
|
+
return this;
|
|
2433
|
+
};
|
|
2434
|
+
|
|
2435
|
+
_proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
|
|
2436
|
+
requireNonNull(textStyle, 'textStyle');
|
|
2437
|
+
|
|
2438
|
+
if (textStyle !== _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL && textStyle !== _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT) {
|
|
2439
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]('Style must be either full or short');
|
|
2515
2440
|
}
|
|
2516
|
-
|
|
2441
|
+
|
|
2442
|
+
this._appendInternal(new _parser_LocalizedOffsetPrinterParser__WEBPACK_IMPORTED_MODULE_5__["default"](textStyle));
|
|
2443
|
+
|
|
2444
|
+
return this;
|
|
2445
|
+
};
|
|
2517
2446
|
|
|
2518
2447
|
return CldrDateTimeFormatterBuilder;
|
|
2519
2448
|
}(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"]);
|
|
@@ -2538,12 +2467,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2538
2467
|
/* harmony import */ var cldr_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cldr_data__WEBPACK_IMPORTED_MODULE_1__);
|
|
2539
2468
|
/* harmony import */ var _LocaleStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../LocaleStore */ "./src/format/LocaleStore.js");
|
|
2540
2469
|
/* harmony import */ var _CldrCache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CldrCache */ "./src/format/cldr/CldrCache.js");
|
|
2541
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2542
|
-
|
|
2543
|
-
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); } }
|
|
2544
|
-
|
|
2545
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
2546
|
-
|
|
2547
2470
|
/*
|
|
2548
2471
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
2549
2472
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -2555,218 +2478,210 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
2555
2478
|
|
|
2556
2479
|
var CldrDateTimeTextProvider = function () {
|
|
2557
2480
|
function CldrDateTimeTextProvider() {
|
|
2558
|
-
_classCallCheck(this, CldrDateTimeTextProvider);
|
|
2559
|
-
|
|
2560
2481
|
this._cache = {};
|
|
2561
2482
|
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["loadCldrData"])('supplemental/likelySubtags.json');
|
|
2562
2483
|
}
|
|
2563
2484
|
|
|
2564
|
-
|
|
2565
|
-
key: "getAvailableLocales",
|
|
2566
|
-
value: function getAvailableLocales() {
|
|
2567
|
-
if (true) {
|
|
2568
|
-
return ["zh.*"];
|
|
2569
|
-
}
|
|
2485
|
+
var _proto = CldrDateTimeTextProvider.prototype;
|
|
2570
2486
|
|
|
2571
|
-
|
|
2487
|
+
_proto.getAvailableLocales = function getAvailableLocales() {
|
|
2488
|
+
if (true) {
|
|
2489
|
+
return ["zh.*"];
|
|
2572
2490
|
}
|
|
2573
|
-
}, {
|
|
2574
|
-
key: "getText",
|
|
2575
|
-
value: function getText(field, value, style, locale) {
|
|
2576
|
-
var store = this._findStore(field, locale);
|
|
2577
2491
|
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
}
|
|
2492
|
+
return cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('availableLocales.json').availableLocales;
|
|
2493
|
+
};
|
|
2581
2494
|
|
|
2582
|
-
|
|
2495
|
+
_proto.getText = function getText(field, value, style, locale) {
|
|
2496
|
+
var store = this._findStore(field, locale);
|
|
2497
|
+
|
|
2498
|
+
if (store instanceof _LocaleStore__WEBPACK_IMPORTED_MODULE_2__["LocaleStore"]) {
|
|
2499
|
+
return store.getText(value, style);
|
|
2583
2500
|
}
|
|
2584
|
-
}, {
|
|
2585
|
-
key: "getTextIterator",
|
|
2586
|
-
value: function getTextIterator(field, style, locale) {
|
|
2587
|
-
var store = this._findStore(field, locale);
|
|
2588
2501
|
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
}
|
|
2502
|
+
return null;
|
|
2503
|
+
};
|
|
2592
2504
|
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
}, {
|
|
2596
|
-
key: "_findStore",
|
|
2597
|
-
value: function _findStore(field, locale) {
|
|
2598
|
-
var key = Object(_LocaleStore__WEBPACK_IMPORTED_MODULE_2__["createEntry"])(field, locale);
|
|
2599
|
-
var store = this._cache[key];
|
|
2600
|
-
|
|
2601
|
-
if (store === undefined) {
|
|
2602
|
-
store = this._createStore(field, locale);
|
|
2603
|
-
this._cache[key] = store;
|
|
2604
|
-
}
|
|
2505
|
+
_proto.getTextIterator = function getTextIterator(field, style, locale) {
|
|
2506
|
+
var store = this._findStore(field, locale);
|
|
2605
2507
|
|
|
2606
|
-
|
|
2508
|
+
if (store instanceof _LocaleStore__WEBPACK_IMPORTED_MODULE_2__["LocaleStore"]) {
|
|
2509
|
+
return store.getTextIterator(style);
|
|
2607
2510
|
}
|
|
2608
|
-
}, {
|
|
2609
|
-
key: "_createStore",
|
|
2610
|
-
value: function _createStore(field, locale) {
|
|
2611
|
-
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["loadCldrData"])("main/".concat(locale.localeString(), "/ca-gregorian.json"));
|
|
2612
|
-
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["getOrCreateCldrInstance"])(locale.localeString());
|
|
2613
|
-
|
|
2614
|
-
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) {
|
|
2615
|
-
var monthsData = cldr.main('dates/calendars/gregorian/months/format');
|
|
2616
|
-
var styleMap = {};
|
|
2617
|
-
var data = {};
|
|
2618
|
-
data[1] = monthsData.wide[1];
|
|
2619
|
-
data[2] = monthsData.wide[2];
|
|
2620
|
-
data[3] = monthsData.wide[3];
|
|
2621
|
-
data[4] = monthsData.wide[4];
|
|
2622
|
-
data[5] = monthsData.wide[5];
|
|
2623
|
-
data[6] = monthsData.wide[6];
|
|
2624
|
-
data[7] = monthsData.wide[7];
|
|
2625
|
-
data[8] = monthsData.wide[8];
|
|
2626
|
-
data[9] = monthsData.wide[9];
|
|
2627
|
-
data[10] = monthsData.wide[10];
|
|
2628
|
-
data[11] = monthsData.wide[11];
|
|
2629
|
-
data[12] = monthsData.wide[12];
|
|
2630
|
-
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = data;
|
|
2631
|
-
data = {};
|
|
2632
|
-
data[1] = monthsData.narrow[1];
|
|
2633
|
-
data[2] = monthsData.narrow[2];
|
|
2634
|
-
data[3] = monthsData.narrow[3];
|
|
2635
|
-
data[4] = monthsData.narrow[4];
|
|
2636
|
-
data[5] = monthsData.narrow[5];
|
|
2637
|
-
data[6] = monthsData.narrow[6];
|
|
2638
|
-
data[7] = monthsData.narrow[7];
|
|
2639
|
-
data[8] = monthsData.narrow[8];
|
|
2640
|
-
data[9] = monthsData.narrow[9];
|
|
2641
|
-
data[10] = monthsData.narrow[10];
|
|
2642
|
-
data[11] = monthsData.narrow[11];
|
|
2643
|
-
data[12] = monthsData.narrow[12];
|
|
2644
|
-
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = data;
|
|
2645
|
-
data = {};
|
|
2646
|
-
data[1] = monthsData.abbreviated[1];
|
|
2647
|
-
data[2] = monthsData.abbreviated[2];
|
|
2648
|
-
data[3] = monthsData.abbreviated[3];
|
|
2649
|
-
data[4] = monthsData.abbreviated[4];
|
|
2650
|
-
data[5] = monthsData.abbreviated[5];
|
|
2651
|
-
data[6] = monthsData.abbreviated[6];
|
|
2652
|
-
data[7] = monthsData.abbreviated[7];
|
|
2653
|
-
data[8] = monthsData.abbreviated[8];
|
|
2654
|
-
data[9] = monthsData.abbreviated[9];
|
|
2655
|
-
data[10] = monthsData.abbreviated[10];
|
|
2656
|
-
data[11] = monthsData.abbreviated[11];
|
|
2657
|
-
data[12] = monthsData.abbreviated[12];
|
|
2658
|
-
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = data;
|
|
2659
|
-
return this._createLocaleStore(styleMap);
|
|
2660
|
-
}
|
|
2661
2511
|
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
var _styleMap = {};
|
|
2665
|
-
var _data = {};
|
|
2666
|
-
_data[1] = daysData.wide.mon;
|
|
2667
|
-
_data[2] = daysData.wide.tue;
|
|
2668
|
-
_data[3] = daysData.wide.wed;
|
|
2669
|
-
_data[4] = daysData.wide.thu;
|
|
2670
|
-
_data[5] = daysData.wide.fri;
|
|
2671
|
-
_data[6] = daysData.wide.sat;
|
|
2672
|
-
_data[7] = daysData.wide.sun;
|
|
2673
|
-
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data;
|
|
2674
|
-
_data = {};
|
|
2675
|
-
_data[1] = daysData.narrow.mon;
|
|
2676
|
-
_data[2] = daysData.narrow.tue;
|
|
2677
|
-
_data[3] = daysData.narrow.wed;
|
|
2678
|
-
_data[4] = daysData.narrow.thu;
|
|
2679
|
-
_data[5] = daysData.narrow.fri;
|
|
2680
|
-
_data[6] = daysData.narrow.sat;
|
|
2681
|
-
_data[7] = daysData.narrow.sun;
|
|
2682
|
-
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data;
|
|
2683
|
-
_data = {};
|
|
2684
|
-
_data[1] = daysData.abbreviated.mon;
|
|
2685
|
-
_data[2] = daysData.abbreviated.tue;
|
|
2686
|
-
_data[3] = daysData.abbreviated.wed;
|
|
2687
|
-
_data[4] = daysData.abbreviated.thu;
|
|
2688
|
-
_data[5] = daysData.abbreviated.fri;
|
|
2689
|
-
_data[6] = daysData.abbreviated.sat;
|
|
2690
|
-
_data[7] = daysData.abbreviated.sun;
|
|
2691
|
-
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data;
|
|
2692
|
-
return this._createLocaleStore(_styleMap);
|
|
2693
|
-
}
|
|
2512
|
+
return null;
|
|
2513
|
+
};
|
|
2694
2514
|
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
var _data2 = {};
|
|
2699
|
-
_data2[0] = dayPeriodsData.wide.am;
|
|
2700
|
-
_data2[1] = dayPeriodsData.wide.pm;
|
|
2701
|
-
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data2;
|
|
2702
|
-
_data2 = {};
|
|
2703
|
-
_data2[0] = dayPeriodsData.narrow.am;
|
|
2704
|
-
_data2[1] = dayPeriodsData.narrow.pm;
|
|
2705
|
-
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data2;
|
|
2706
|
-
_data2 = {};
|
|
2707
|
-
_data2[0] = dayPeriodsData.abbreviated.am;
|
|
2708
|
-
_data2[1] = dayPeriodsData.abbreviated.pm;
|
|
2709
|
-
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data2;
|
|
2710
|
-
return this._createLocaleStore(_styleMap2);
|
|
2711
|
-
}
|
|
2515
|
+
_proto._findStore = function _findStore(field, locale) {
|
|
2516
|
+
var key = Object(_LocaleStore__WEBPACK_IMPORTED_MODULE_2__["createEntry"])(field, locale);
|
|
2517
|
+
var store = this._cache[key];
|
|
2712
2518
|
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
_data3[0] = erasData.eraNames['0'];
|
|
2718
|
-
_data3[1] = erasData.eraNames['1'];
|
|
2719
|
-
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data3;
|
|
2720
|
-
_data3 = {};
|
|
2721
|
-
_data3[0] = erasData.eraNarrow['0'];
|
|
2722
|
-
_data3[1] = erasData.eraNarrow['1'];
|
|
2723
|
-
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data3;
|
|
2724
|
-
_data3 = {};
|
|
2725
|
-
_data3[0] = erasData.eraAbbr['0'];
|
|
2726
|
-
_data3[1] = erasData.eraAbbr['1'];
|
|
2727
|
-
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data3;
|
|
2728
|
-
return this._createLocaleStore(_styleMap3);
|
|
2729
|
-
}
|
|
2519
|
+
if (store === undefined) {
|
|
2520
|
+
store = this._createStore(field, locale);
|
|
2521
|
+
this._cache[key] = store;
|
|
2522
|
+
}
|
|
2730
2523
|
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
var _styleMap4 = {};
|
|
2734
|
-
var _data4 = {};
|
|
2735
|
-
_data4[1] = quartersData.wide['1'];
|
|
2736
|
-
_data4[2] = quartersData.wide['2'];
|
|
2737
|
-
_data4[3] = quartersData.wide['3'];
|
|
2738
|
-
_data4[4] = quartersData.wide['4'];
|
|
2739
|
-
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data4;
|
|
2740
|
-
_data4 = {};
|
|
2741
|
-
_data4[1] = quartersData.narrow['1'];
|
|
2742
|
-
_data4[2] = quartersData.narrow['2'];
|
|
2743
|
-
_data4[3] = quartersData.narrow['3'];
|
|
2744
|
-
_data4[4] = quartersData.narrow['4'];
|
|
2745
|
-
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data4;
|
|
2746
|
-
_data4 = {};
|
|
2747
|
-
_data4[1] = quartersData.abbreviated['1'];
|
|
2748
|
-
_data4[2] = quartersData.abbreviated['2'];
|
|
2749
|
-
_data4[3] = quartersData.abbreviated['3'];
|
|
2750
|
-
_data4[4] = quartersData.abbreviated['4'];
|
|
2751
|
-
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data4;
|
|
2752
|
-
return this._createLocaleStore(_styleMap4);
|
|
2753
|
-
}
|
|
2524
|
+
return store;
|
|
2525
|
+
};
|
|
2754
2526
|
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2527
|
+
_proto._createStore = function _createStore(field, locale) {
|
|
2528
|
+
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["loadCldrData"])("main/" + locale.localeString() + "/ca-gregorian.json");
|
|
2529
|
+
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_3__["getOrCreateCldrInstance"])(locale.localeString());
|
|
2530
|
+
|
|
2531
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) {
|
|
2532
|
+
var monthsData = cldr.main('dates/calendars/gregorian/months/format');
|
|
2533
|
+
var styleMap = {};
|
|
2534
|
+
var data = {};
|
|
2535
|
+
data[1] = monthsData.wide[1];
|
|
2536
|
+
data[2] = monthsData.wide[2];
|
|
2537
|
+
data[3] = monthsData.wide[3];
|
|
2538
|
+
data[4] = monthsData.wide[4];
|
|
2539
|
+
data[5] = monthsData.wide[5];
|
|
2540
|
+
data[6] = monthsData.wide[6];
|
|
2541
|
+
data[7] = monthsData.wide[7];
|
|
2542
|
+
data[8] = monthsData.wide[8];
|
|
2543
|
+
data[9] = monthsData.wide[9];
|
|
2544
|
+
data[10] = monthsData.wide[10];
|
|
2545
|
+
data[11] = monthsData.wide[11];
|
|
2546
|
+
data[12] = monthsData.wide[12];
|
|
2547
|
+
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = data;
|
|
2548
|
+
data = {};
|
|
2549
|
+
data[1] = monthsData.narrow[1];
|
|
2550
|
+
data[2] = monthsData.narrow[2];
|
|
2551
|
+
data[3] = monthsData.narrow[3];
|
|
2552
|
+
data[4] = monthsData.narrow[4];
|
|
2553
|
+
data[5] = monthsData.narrow[5];
|
|
2554
|
+
data[6] = monthsData.narrow[6];
|
|
2555
|
+
data[7] = monthsData.narrow[7];
|
|
2556
|
+
data[8] = monthsData.narrow[8];
|
|
2557
|
+
data[9] = monthsData.narrow[9];
|
|
2558
|
+
data[10] = monthsData.narrow[10];
|
|
2559
|
+
data[11] = monthsData.narrow[11];
|
|
2560
|
+
data[12] = monthsData.narrow[12];
|
|
2561
|
+
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = data;
|
|
2562
|
+
data = {};
|
|
2563
|
+
data[1] = monthsData.abbreviated[1];
|
|
2564
|
+
data[2] = monthsData.abbreviated[2];
|
|
2565
|
+
data[3] = monthsData.abbreviated[3];
|
|
2566
|
+
data[4] = monthsData.abbreviated[4];
|
|
2567
|
+
data[5] = monthsData.abbreviated[5];
|
|
2568
|
+
data[6] = monthsData.abbreviated[6];
|
|
2569
|
+
data[7] = monthsData.abbreviated[7];
|
|
2570
|
+
data[8] = monthsData.abbreviated[8];
|
|
2571
|
+
data[9] = monthsData.abbreviated[9];
|
|
2572
|
+
data[10] = monthsData.abbreviated[10];
|
|
2573
|
+
data[11] = monthsData.abbreviated[11];
|
|
2574
|
+
data[12] = monthsData.abbreviated[12];
|
|
2575
|
+
styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = data;
|
|
2576
|
+
return this._createLocaleStore(styleMap);
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK) {
|
|
2580
|
+
var daysData = cldr.main('dates/calendars/gregorian/days/format');
|
|
2581
|
+
var _styleMap = {};
|
|
2582
|
+
var _data = {};
|
|
2583
|
+
_data[1] = daysData.wide.mon;
|
|
2584
|
+
_data[2] = daysData.wide.tue;
|
|
2585
|
+
_data[3] = daysData.wide.wed;
|
|
2586
|
+
_data[4] = daysData.wide.thu;
|
|
2587
|
+
_data[5] = daysData.wide.fri;
|
|
2588
|
+
_data[6] = daysData.wide.sat;
|
|
2589
|
+
_data[7] = daysData.wide.sun;
|
|
2590
|
+
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data;
|
|
2591
|
+
_data = {};
|
|
2592
|
+
_data[1] = daysData.narrow.mon;
|
|
2593
|
+
_data[2] = daysData.narrow.tue;
|
|
2594
|
+
_data[3] = daysData.narrow.wed;
|
|
2595
|
+
_data[4] = daysData.narrow.thu;
|
|
2596
|
+
_data[5] = daysData.narrow.fri;
|
|
2597
|
+
_data[6] = daysData.narrow.sat;
|
|
2598
|
+
_data[7] = daysData.narrow.sun;
|
|
2599
|
+
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data;
|
|
2600
|
+
_data = {};
|
|
2601
|
+
_data[1] = daysData.abbreviated.mon;
|
|
2602
|
+
_data[2] = daysData.abbreviated.tue;
|
|
2603
|
+
_data[3] = daysData.abbreviated.wed;
|
|
2604
|
+
_data[4] = daysData.abbreviated.thu;
|
|
2605
|
+
_data[5] = daysData.abbreviated.fri;
|
|
2606
|
+
_data[6] = daysData.abbreviated.sat;
|
|
2607
|
+
_data[7] = daysData.abbreviated.sun;
|
|
2608
|
+
_styleMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data;
|
|
2609
|
+
return this._createLocaleStore(_styleMap);
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].AMPM_OF_DAY) {
|
|
2613
|
+
var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
|
|
2614
|
+
var _styleMap2 = {};
|
|
2615
|
+
var _data2 = {};
|
|
2616
|
+
_data2[0] = dayPeriodsData.wide.am;
|
|
2617
|
+
_data2[1] = dayPeriodsData.wide.pm;
|
|
2618
|
+
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data2;
|
|
2619
|
+
_data2 = {};
|
|
2620
|
+
_data2[0] = dayPeriodsData.narrow.am;
|
|
2621
|
+
_data2[1] = dayPeriodsData.narrow.pm;
|
|
2622
|
+
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data2;
|
|
2623
|
+
_data2 = {};
|
|
2624
|
+
_data2[0] = dayPeriodsData.abbreviated.am;
|
|
2625
|
+
_data2[1] = dayPeriodsData.abbreviated.pm;
|
|
2626
|
+
_styleMap2[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data2;
|
|
2627
|
+
return this._createLocaleStore(_styleMap2);
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].ERA) {
|
|
2631
|
+
var erasData = cldr.main('dates/calendars/gregorian/eras');
|
|
2632
|
+
var _styleMap3 = {};
|
|
2633
|
+
var _data3 = {};
|
|
2634
|
+
_data3[0] = erasData.eraNames['0'];
|
|
2635
|
+
_data3[1] = erasData.eraNames['1'];
|
|
2636
|
+
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data3;
|
|
2637
|
+
_data3 = {};
|
|
2638
|
+
_data3[0] = erasData.eraNarrow['0'];
|
|
2639
|
+
_data3[1] = erasData.eraNarrow['1'];
|
|
2640
|
+
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data3;
|
|
2641
|
+
_data3 = {};
|
|
2642
|
+
_data3[0] = erasData.eraAbbr['0'];
|
|
2643
|
+
_data3[1] = erasData.eraAbbr['1'];
|
|
2644
|
+
_styleMap3[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data3;
|
|
2645
|
+
return this._createLocaleStore(_styleMap3);
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
if (field === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].QUARTER_OF_YEAR) {
|
|
2649
|
+
var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
|
|
2650
|
+
var _styleMap4 = {};
|
|
2651
|
+
var _data4 = {};
|
|
2652
|
+
_data4[1] = quartersData.wide['1'];
|
|
2653
|
+
_data4[2] = quartersData.wide['2'];
|
|
2654
|
+
_data4[3] = quartersData.wide['3'];
|
|
2655
|
+
_data4[4] = quartersData.wide['4'];
|
|
2656
|
+
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL] = _data4;
|
|
2657
|
+
_data4 = {};
|
|
2658
|
+
_data4[1] = quartersData.narrow['1'];
|
|
2659
|
+
_data4[2] = quartersData.narrow['2'];
|
|
2660
|
+
_data4[3] = quartersData.narrow['3'];
|
|
2661
|
+
_data4[4] = quartersData.narrow['4'];
|
|
2662
|
+
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW] = _data4;
|
|
2663
|
+
_data4 = {};
|
|
2664
|
+
_data4[1] = quartersData.abbreviated['1'];
|
|
2665
|
+
_data4[2] = quartersData.abbreviated['2'];
|
|
2666
|
+
_data4[3] = quartersData.abbreviated['3'];
|
|
2667
|
+
_data4[4] = quartersData.abbreviated['4'];
|
|
2668
|
+
_styleMap4[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT] = _data4;
|
|
2669
|
+
return this._createLocaleStore(_styleMap4);
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
return null;
|
|
2673
|
+
};
|
|
2674
|
+
|
|
2675
|
+
_proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
|
|
2676
|
+
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL];
|
|
2677
|
+
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].SHORT];
|
|
2766
2678
|
|
|
2767
|
-
|
|
2679
|
+
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) {
|
|
2680
|
+
valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW_STANDALONE] = valueTextMap[_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].NARROW];
|
|
2768
2681
|
}
|
|
2769
|
-
|
|
2682
|
+
|
|
2683
|
+
return new _LocaleStore__WEBPACK_IMPORTED_MODULE_2__["LocaleStore"](valueTextMap);
|
|
2684
|
+
};
|
|
2770
2685
|
|
|
2771
2686
|
return CldrDateTimeTextProvider;
|
|
2772
2687
|
}();
|
|
@@ -2788,18 +2703,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2788
2703
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
2789
2704
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
2790
2705
|
/* harmony import */ var _CldrCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CldrCache */ "./src/format/cldr/CldrCache.js");
|
|
2791
|
-
function
|
|
2706
|
+
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."); }
|
|
2792
2707
|
|
|
2793
2708
|
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); }
|
|
2794
2709
|
|
|
2795
2710
|
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; }
|
|
2796
2711
|
|
|
2797
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2798
|
-
|
|
2799
|
-
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); } }
|
|
2800
|
-
|
|
2801
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
2802
|
-
|
|
2803
2712
|
/*
|
|
2804
2713
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
2805
2714
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -2824,8 +2733,6 @@ var resolveZoneIdTextCache = {};
|
|
|
2824
2733
|
|
|
2825
2734
|
var CldrZoneTextPrinterParser = function () {
|
|
2826
2735
|
function CldrZoneTextPrinterParser(textStyle) {
|
|
2827
|
-
_classCallCheck(this, CldrZoneTextPrinterParser);
|
|
2828
|
-
|
|
2829
2736
|
requireNonNull(textStyle, 'textStyle');
|
|
2830
2737
|
requireInstance(textStyle, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"], 'textStyle');
|
|
2831
2738
|
this._textStyle = textStyle;
|
|
@@ -2834,202 +2741,178 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
2834
2741
|
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])('supplemental/metaZones.json');
|
|
2835
2742
|
}
|
|
2836
2743
|
|
|
2837
|
-
|
|
2838
|
-
key: "_cachedResolveZoneIdText",
|
|
2839
|
-
value: function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
|
|
2840
|
-
if (resolveZoneIdTextCache[cldr.locale] == null) {
|
|
2841
|
-
resolveZoneIdTextCache[cldr.locale] = {};
|
|
2842
|
-
}
|
|
2744
|
+
var _proto = CldrZoneTextPrinterParser.prototype;
|
|
2843
2745
|
|
|
2844
|
-
|
|
2746
|
+
_proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
|
|
2747
|
+
if (resolveZoneIdTextCache[cldr.locale] == null) {
|
|
2748
|
+
resolveZoneIdTextCache[cldr.locale] = {};
|
|
2749
|
+
}
|
|
2845
2750
|
|
|
2846
|
-
|
|
2847
|
-
zoneIdToStyle[zoneId] = {};
|
|
2848
|
-
}
|
|
2751
|
+
var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
|
|
2849
2752
|
|
|
2850
|
-
|
|
2753
|
+
if (zoneIdToStyle[zoneId] == null) {
|
|
2754
|
+
zoneIdToStyle[zoneId] = {};
|
|
2755
|
+
}
|
|
2851
2756
|
|
|
2852
|
-
|
|
2853
|
-
styleToType[style] = {};
|
|
2854
|
-
}
|
|
2757
|
+
var styleToType = zoneIdToStyle[zoneId];
|
|
2855
2758
|
|
|
2856
|
-
|
|
2759
|
+
if (styleToType[style] == null) {
|
|
2760
|
+
styleToType[style] = {};
|
|
2761
|
+
}
|
|
2857
2762
|
|
|
2858
|
-
|
|
2859
|
-
typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
|
|
2860
|
-
}
|
|
2763
|
+
var typeToResolvedZoneIdText = styleToType[style];
|
|
2861
2764
|
|
|
2862
|
-
|
|
2765
|
+
if (typeToResolvedZoneIdText[type] == null) {
|
|
2766
|
+
typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
|
|
2863
2767
|
}
|
|
2864
|
-
}, {
|
|
2865
|
-
key: "_resolveZoneIdText",
|
|
2866
|
-
value: function _resolveZoneIdText(cldr, zoneId, style, type) {
|
|
2867
|
-
var zoneData = cldr.main("dates/timeZoneNames/zone/".concat(zoneId, "/").concat(style, "/").concat(type));
|
|
2868
2768
|
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2769
|
+
return typeToResolvedZoneIdText[type];
|
|
2770
|
+
};
|
|
2771
|
+
|
|
2772
|
+
_proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
|
|
2773
|
+
var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
|
|
2873
2774
|
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2775
|
+
if (zoneData) {
|
|
2776
|
+
return zoneData;
|
|
2777
|
+
} else {
|
|
2778
|
+
var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
|
|
2779
|
+
|
|
2780
|
+
if (metazoneInfo) {
|
|
2781
|
+
var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
|
|
2782
|
+
var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
|
|
2783
|
+
|
|
2784
|
+
if (metaZoneData) {
|
|
2785
|
+
return metaZoneData;
|
|
2786
|
+
} else {
|
|
2787
|
+
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
|
|
2788
|
+
|
|
2789
|
+
if (!metaZoneData) {
|
|
2790
|
+
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
|
|
2791
|
+
}
|
|
2877
2792
|
|
|
2878
2793
|
if (metaZoneData) {
|
|
2879
2794
|
return metaZoneData;
|
|
2880
2795
|
} else {
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
if (!metaZoneData) {
|
|
2884
|
-
metaZoneData = cldr.main("dates/timeZoneNames/metazone/".concat(metazone, "/").concat(style, "/standard"));
|
|
2885
|
-
}
|
|
2796
|
+
var mapZones = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateMapZones"])(cldr);
|
|
2797
|
+
var preferredZone = mapZones[metazone][cldr.attributes.territory];
|
|
2886
2798
|
|
|
2887
|
-
if (
|
|
2888
|
-
|
|
2799
|
+
if (preferredZone) {
|
|
2800
|
+
if (preferredZone !== zoneId) {
|
|
2801
|
+
return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
|
|
2802
|
+
}
|
|
2889
2803
|
} else {
|
|
2890
|
-
var
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
if (preferredZone !== zoneId) {
|
|
2895
|
-
return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
|
|
2896
|
-
}
|
|
2897
|
-
} else {
|
|
2898
|
-
var goldenZone = mapZones[metazone]['001'];
|
|
2899
|
-
|
|
2900
|
-
if (goldenZone !== zoneId) {
|
|
2901
|
-
return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
|
|
2902
|
-
}
|
|
2804
|
+
var goldenZone = mapZones[metazone]['001'];
|
|
2805
|
+
|
|
2806
|
+
if (goldenZone !== zoneId) {
|
|
2807
|
+
return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
|
|
2903
2808
|
}
|
|
2904
2809
|
}
|
|
2905
2810
|
}
|
|
2906
2811
|
}
|
|
2907
2812
|
}
|
|
2908
2813
|
}
|
|
2909
|
-
}
|
|
2910
|
-
key: "print",
|
|
2911
|
-
value: function print(context, buf) {
|
|
2912
|
-
var zone = context.getValueQuery(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalQueries"].zoneId());
|
|
2913
|
-
|
|
2914
|
-
if (zone == null) {
|
|
2915
|
-
return false;
|
|
2916
|
-
}
|
|
2917
|
-
|
|
2918
|
-
if (zone.normalized() instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"]) {
|
|
2919
|
-
buf.append(zone.id());
|
|
2920
|
-
return true;
|
|
2921
|
-
}
|
|
2922
|
-
|
|
2923
|
-
var daylight = false;
|
|
2924
|
-
var hasDaylightSupport = false;
|
|
2925
|
-
var tzType = hasDaylightSupport ? daylight ? 'daylight' : 'standard' : 'generic';
|
|
2926
|
-
var tzstyle = this._textStyle.asNormal() === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL ? 'long' : 'short';
|
|
2927
|
-
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])("main/".concat(context.locale().localeString(), "/timeZoneNames.json"));
|
|
2928
|
-
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateCldrInstance"])(context.locale().localeString());
|
|
2814
|
+
};
|
|
2929
2815
|
|
|
2930
|
-
|
|
2816
|
+
_proto.print = function print(context, buf) {
|
|
2817
|
+
var zone = context.getValueQuery(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TemporalQueries"].zoneId());
|
|
2931
2818
|
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
buf.append(zone.id());
|
|
2936
|
-
}
|
|
2819
|
+
if (zone == null) {
|
|
2820
|
+
return false;
|
|
2821
|
+
}
|
|
2937
2822
|
|
|
2823
|
+
if (zone.normalized() instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"]) {
|
|
2824
|
+
buf.append(zone.id());
|
|
2938
2825
|
return true;
|
|
2939
2826
|
}
|
|
2940
|
-
}, {
|
|
2941
|
-
key: "_resolveZoneIds",
|
|
2942
|
-
value: function _resolveZoneIds(localString) {
|
|
2943
|
-
if (this._zoneIdsLocales[localString] != null) {
|
|
2944
|
-
return this._zoneIdsLocales[localString];
|
|
2945
|
-
}
|
|
2946
2827
|
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2828
|
+
var daylight = false;
|
|
2829
|
+
var hasDaylightSupport = false;
|
|
2830
|
+
var tzType = hasDaylightSupport ? daylight ? 'daylight' : 'standard' : 'generic';
|
|
2831
|
+
var tzstyle = this._textStyle.asNormal() === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL ? 'long' : 'short';
|
|
2832
|
+
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])("main/" + context.locale().localeString() + "/timeZoneNames.json");
|
|
2833
|
+
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateCldrInstance"])(context.locale().localeString());
|
|
2950
2834
|
|
|
2951
|
-
|
|
2952
|
-
_step;
|
|
2835
|
+
var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
|
|
2953
2836
|
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2837
|
+
if (text) {
|
|
2838
|
+
buf.append(text);
|
|
2839
|
+
} else {
|
|
2840
|
+
buf.append(zone.id());
|
|
2841
|
+
}
|
|
2959
2842
|
|
|
2960
|
-
|
|
2843
|
+
return true;
|
|
2844
|
+
};
|
|
2961
2845
|
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2846
|
+
_proto._resolveZoneIds = function _resolveZoneIds(localString) {
|
|
2847
|
+
if (this._zoneIdsLocales[localString] != null) {
|
|
2848
|
+
return this._zoneIdsLocales[localString];
|
|
2849
|
+
}
|
|
2965
2850
|
|
|
2966
|
-
|
|
2851
|
+
var ids = {};
|
|
2852
|
+
Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["loadCldrData"])("main/" + localString + "/timeZoneNames.json");
|
|
2853
|
+
var cldr = Object(_CldrCache__WEBPACK_IMPORTED_MODULE_1__["getOrCreateCldrInstance"])(localString);
|
|
2967
2854
|
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2855
|
+
for (var _iterator = _createForOfIteratorHelperLoose(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneRulesProvider"].getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
|
|
2856
|
+
var id = _step.value;
|
|
2857
|
+
ids[id] = id;
|
|
2858
|
+
var tzstyle = this._textStyle.asNormal() === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL ? 'long' : 'short';
|
|
2971
2859
|
|
|
2972
|
-
|
|
2860
|
+
var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
|
|
2973
2861
|
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
}
|
|
2977
|
-
}
|
|
2978
|
-
} catch (err) {
|
|
2979
|
-
_iterator.e(err);
|
|
2980
|
-
} finally {
|
|
2981
|
-
_iterator.f();
|
|
2862
|
+
if (genericText) {
|
|
2863
|
+
ids[genericText] = id;
|
|
2982
2864
|
}
|
|
2983
2865
|
|
|
2984
|
-
var
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
};
|
|
2989
|
-
return this._zoneIdsLocales[localString];
|
|
2990
|
-
}
|
|
2991
|
-
}, {
|
|
2992
|
-
key: "parse",
|
|
2993
|
-
value: function parse(context, text, position) {
|
|
2994
|
-
for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
|
|
2995
|
-
var name = _arr[_i];
|
|
2996
|
-
|
|
2997
|
-
if (context.subSequenceEquals(text, position, name, 0, name.length)) {
|
|
2998
|
-
context.setParsedZone(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneId"].of(name));
|
|
2999
|
-
return position + name.length;
|
|
3000
|
-
}
|
|
2866
|
+
var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
|
|
2867
|
+
|
|
2868
|
+
if (standardText) {
|
|
2869
|
+
ids[standardText] = id;
|
|
3001
2870
|
}
|
|
3002
2871
|
|
|
3003
|
-
var
|
|
3004
|
-
ids = _this$_resolveZoneIds.ids,
|
|
3005
|
-
sortedKeys = _this$_resolveZoneIds.sortedKeys;
|
|
2872
|
+
var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
|
|
3006
2873
|
|
|
3007
|
-
|
|
3008
|
-
|
|
2874
|
+
if (daylightText) {
|
|
2875
|
+
ids[daylightText] = id;
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
3009
2878
|
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
2879
|
+
var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
|
|
2880
|
+
this._zoneIdsLocales[localString] = {
|
|
2881
|
+
ids: ids,
|
|
2882
|
+
sortedKeys: sortedKeys
|
|
2883
|
+
};
|
|
2884
|
+
return this._zoneIdsLocales[localString];
|
|
2885
|
+
};
|
|
3013
2886
|
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
}
|
|
3018
|
-
}
|
|
3019
|
-
} catch (err) {
|
|
3020
|
-
_iterator2.e(err);
|
|
3021
|
-
} finally {
|
|
3022
|
-
_iterator2.f();
|
|
3023
|
-
}
|
|
2887
|
+
_proto.parse = function parse(context, text, position) {
|
|
2888
|
+
for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
|
|
2889
|
+
var name = _arr[_i];
|
|
3024
2890
|
|
|
3025
|
-
|
|
2891
|
+
if (context.subSequenceEquals(text, position, name, 0, name.length)) {
|
|
2892
|
+
context.setParsedZone(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneId"].of(name));
|
|
2893
|
+
return position + name.length;
|
|
2894
|
+
}
|
|
3026
2895
|
}
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
2896
|
+
|
|
2897
|
+
var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
|
|
2898
|
+
ids = _this$_resolveZoneIds.ids,
|
|
2899
|
+
sortedKeys = _this$_resolveZoneIds.sortedKeys;
|
|
2900
|
+
|
|
2901
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
|
|
2902
|
+
var _name = _step2.value;
|
|
2903
|
+
|
|
2904
|
+
if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
|
|
2905
|
+
context.setParsedZone(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneId"].of(ids[_name]));
|
|
2906
|
+
return position + _name.length;
|
|
2907
|
+
}
|
|
3031
2908
|
}
|
|
3032
|
-
|
|
2909
|
+
|
|
2910
|
+
return ~position;
|
|
2911
|
+
};
|
|
2912
|
+
|
|
2913
|
+
_proto.toString = function toString() {
|
|
2914
|
+
return "ZoneText(" + this._textStyle + ")";
|
|
2915
|
+
};
|
|
3033
2916
|
|
|
3034
2917
|
return CldrZoneTextPrinterParser;
|
|
3035
2918
|
}();
|
|
@@ -3050,12 +2933,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3050
2933
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LocalizedOffsetPrinterParser; });
|
|
3051
2934
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
3052
2935
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
3053
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3054
|
-
|
|
3055
|
-
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); } }
|
|
3056
|
-
|
|
3057
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3058
|
-
|
|
3059
2936
|
/**
|
|
3060
2937
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
3061
2938
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -3066,180 +2943,174 @@ var MathUtil = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].MathUtil;
|
|
|
3066
2943
|
|
|
3067
2944
|
var LocalizedOffsetPrinterParser = function () {
|
|
3068
2945
|
function LocalizedOffsetPrinterParser(textStyle) {
|
|
3069
|
-
_classCallCheck(this, LocalizedOffsetPrinterParser);
|
|
3070
|
-
|
|
3071
2946
|
this._textStyle = textStyle;
|
|
3072
2947
|
}
|
|
3073
2948
|
|
|
3074
|
-
|
|
3075
|
-
key: "textStyle",
|
|
3076
|
-
value: function textStyle() {
|
|
3077
|
-
return this._textStyle;
|
|
3078
|
-
}
|
|
3079
|
-
}, {
|
|
3080
|
-
key: "print",
|
|
3081
|
-
value: function print(context, buf) {
|
|
3082
|
-
var offsetSecs = context.getValue(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS);
|
|
2949
|
+
var _proto = LocalizedOffsetPrinterParser.prototype;
|
|
3083
2950
|
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
2951
|
+
_proto.textStyle = function textStyle() {
|
|
2952
|
+
return this._textStyle;
|
|
2953
|
+
};
|
|
3087
2954
|
|
|
3088
|
-
|
|
2955
|
+
_proto.print = function print(context, buf) {
|
|
2956
|
+
var offsetSecs = context.getValue(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS);
|
|
3089
2957
|
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
2958
|
+
if (offsetSecs == null) {
|
|
2959
|
+
return false;
|
|
2960
|
+
}
|
|
3093
2961
|
|
|
3094
|
-
|
|
2962
|
+
buf.append('GMT');
|
|
3095
2963
|
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
var absSeconds = Math.abs(MathUtil.intMod(totalSecs, 60));
|
|
3100
|
-
buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
|
|
2964
|
+
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
2965
|
+
return new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
|
|
2966
|
+
}
|
|
3101
2967
|
|
|
3102
|
-
|
|
3103
|
-
buf.append(':').append(MathUtil.intDiv(absMinutes, 10)).append(MathUtil.intMod(absMinutes, 10));
|
|
2968
|
+
var totalSecs = MathUtil.safeToInt(offsetSecs);
|
|
3104
2969
|
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
2970
|
+
if (totalSecs !== 0) {
|
|
2971
|
+
var absHours = Math.abs(MathUtil.intMod(MathUtil.intDiv(totalSecs, 3600), 100));
|
|
2972
|
+
var absMinutes = Math.abs(MathUtil.intMod(MathUtil.intDiv(totalSecs, 60), 60));
|
|
2973
|
+
var absSeconds = Math.abs(MathUtil.intMod(totalSecs, 60));
|
|
2974
|
+
buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
|
|
2975
|
+
|
|
2976
|
+
if (absMinutes > 0 || absSeconds > 0) {
|
|
2977
|
+
buf.append(':').append(MathUtil.intDiv(absMinutes, 10)).append(MathUtil.intMod(absMinutes, 10));
|
|
2978
|
+
|
|
2979
|
+
if (absSeconds > 0) {
|
|
2980
|
+
buf.append(':').append(MathUtil.intDiv(absSeconds, 10)).append(MathUtil.intMod(absSeconds, 10));
|
|
3108
2981
|
}
|
|
3109
2982
|
}
|
|
3110
|
-
|
|
3111
|
-
return true;
|
|
3112
2983
|
}
|
|
3113
|
-
}, {
|
|
3114
|
-
key: "parse",
|
|
3115
|
-
value: function parse(context, text, position) {
|
|
3116
|
-
if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
|
|
3117
|
-
return ~position;
|
|
3118
|
-
}
|
|
3119
2984
|
|
|
3120
|
-
|
|
2985
|
+
return true;
|
|
2986
|
+
};
|
|
3121
2987
|
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
2988
|
+
_proto.parse = function parse(context, text, position) {
|
|
2989
|
+
if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
|
|
2990
|
+
return ~position;
|
|
2991
|
+
}
|
|
3125
2992
|
|
|
3126
|
-
|
|
2993
|
+
position += 3;
|
|
3127
2994
|
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
2995
|
+
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
2996
|
+
return new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeFormatterBuilder"].OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
|
|
2997
|
+
}
|
|
3131
2998
|
|
|
3132
|
-
|
|
2999
|
+
var end = text.length;
|
|
3133
3000
|
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3001
|
+
if (position === end) {
|
|
3002
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, 0, position, position);
|
|
3003
|
+
}
|
|
3137
3004
|
|
|
3138
|
-
|
|
3005
|
+
var sign = text.charAt(position);
|
|
3139
3006
|
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3007
|
+
if (sign !== '+' && sign !== '-') {
|
|
3008
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, 0, position, position);
|
|
3009
|
+
}
|
|
3143
3010
|
|
|
3144
|
-
|
|
3145
|
-
var ch = text.charAt(position);
|
|
3011
|
+
var negative = sign === '-' ? -1 : 1;
|
|
3146
3012
|
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3013
|
+
if (position === end) {
|
|
3014
|
+
return ~position;
|
|
3015
|
+
}
|
|
3150
3016
|
|
|
3151
|
-
|
|
3152
|
-
|
|
3017
|
+
position++;
|
|
3018
|
+
var ch = text.charAt(position);
|
|
3153
3019
|
|
|
3154
|
-
|
|
3155
|
-
|
|
3020
|
+
if (ch < '0' || ch > '9') {
|
|
3021
|
+
return ~position;
|
|
3022
|
+
}
|
|
3156
3023
|
|
|
3157
|
-
|
|
3158
|
-
|
|
3024
|
+
position++;
|
|
3025
|
+
var hour = MathUtil.parseInt(ch);
|
|
3159
3026
|
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
}
|
|
3027
|
+
if (position !== end) {
|
|
3028
|
+
ch = text.charAt(position);
|
|
3163
3029
|
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
}
|
|
3030
|
+
if (ch >= '0' && ch <= '9') {
|
|
3031
|
+
hour = hour * 10 + MathUtil.parseInt(ch);
|
|
3167
3032
|
|
|
3168
|
-
|
|
3169
|
-
|
|
3033
|
+
if (hour > 23) {
|
|
3034
|
+
return ~position;
|
|
3035
|
+
}
|
|
3170
3036
|
|
|
3171
|
-
|
|
3037
|
+
position++;
|
|
3172
3038
|
}
|
|
3039
|
+
}
|
|
3173
3040
|
|
|
3174
|
-
|
|
3041
|
+
if (position === end || text.charAt(position) !== ':') {
|
|
3042
|
+
var _offset = negative * 3600 * hour;
|
|
3175
3043
|
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
}
|
|
3044
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, _offset, position, position);
|
|
3045
|
+
}
|
|
3179
3046
|
|
|
3180
|
-
|
|
3047
|
+
position++;
|
|
3181
3048
|
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3049
|
+
if (position > end - 2) {
|
|
3050
|
+
return ~position;
|
|
3051
|
+
}
|
|
3185
3052
|
|
|
3186
|
-
|
|
3187
|
-
var min = MathUtil.parseInt(ch);
|
|
3188
|
-
ch = text.charAt(position);
|
|
3053
|
+
ch = text.charAt(position);
|
|
3189
3054
|
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3055
|
+
if (ch < '0' || ch > '9') {
|
|
3056
|
+
return ~position;
|
|
3057
|
+
}
|
|
3193
3058
|
|
|
3194
|
-
|
|
3195
|
-
|
|
3059
|
+
position++;
|
|
3060
|
+
var min = MathUtil.parseInt(ch);
|
|
3061
|
+
ch = text.charAt(position);
|
|
3196
3062
|
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3063
|
+
if (ch < '0' || ch > '9') {
|
|
3064
|
+
return ~position;
|
|
3065
|
+
}
|
|
3200
3066
|
|
|
3201
|
-
|
|
3202
|
-
|
|
3067
|
+
position++;
|
|
3068
|
+
min = min * 10 + MathUtil.parseInt(ch);
|
|
3203
3069
|
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
position++;
|
|
3070
|
+
if (min > 59) {
|
|
3071
|
+
return ~position;
|
|
3072
|
+
}
|
|
3208
3073
|
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
}
|
|
3074
|
+
if (position === end || text.charAt(position) !== ':') {
|
|
3075
|
+
var _offset2 = negative * (3600 * hour + 60 * min);
|
|
3212
3076
|
|
|
3213
|
-
|
|
3077
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, _offset2, position, position);
|
|
3078
|
+
}
|
|
3214
3079
|
|
|
3215
|
-
|
|
3216
|
-
return ~position;
|
|
3217
|
-
}
|
|
3080
|
+
position++;
|
|
3218
3081
|
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3082
|
+
if (position > end - 2) {
|
|
3083
|
+
return ~position;
|
|
3084
|
+
}
|
|
3222
3085
|
|
|
3223
|
-
|
|
3224
|
-
return ~position;
|
|
3225
|
-
}
|
|
3086
|
+
ch = text.charAt(position);
|
|
3226
3087
|
|
|
3227
|
-
|
|
3228
|
-
|
|
3088
|
+
if (ch < '0' || ch > '9') {
|
|
3089
|
+
return ~position;
|
|
3090
|
+
}
|
|
3229
3091
|
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3092
|
+
position++;
|
|
3093
|
+
var sec = MathUtil.parseInt(ch);
|
|
3094
|
+
ch = text.charAt(position);
|
|
3233
3095
|
|
|
3234
|
-
|
|
3235
|
-
return
|
|
3096
|
+
if (ch < '0' || ch > '9') {
|
|
3097
|
+
return ~position;
|
|
3236
3098
|
}
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3099
|
+
|
|
3100
|
+
position++;
|
|
3101
|
+
sec = sec * 10 + MathUtil.parseInt(ch);
|
|
3102
|
+
|
|
3103
|
+
if (sec > 59) {
|
|
3104
|
+
return ~position;
|
|
3241
3105
|
}
|
|
3242
|
-
|
|
3106
|
+
|
|
3107
|
+
var offset = negative * (3600 * hour + 60 * min + sec);
|
|
3108
|
+
return context.setParsedField(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].OFFSET_SECONDS, offset, position, position);
|
|
3109
|
+
};
|
|
3110
|
+
|
|
3111
|
+
_proto.toString = function toString() {
|
|
3112
|
+
return "LocalizedOffset(" + this._textStyle + ")";
|
|
3113
|
+
};
|
|
3243
3114
|
|
|
3244
3115
|
return LocalizedOffsetPrinterParser;
|
|
3245
3116
|
}();
|
|
@@ -3260,18 +3131,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3260
3131
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextPrinterParser; });
|
|
3261
3132
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
3262
3133
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
3263
|
-
function
|
|
3134
|
+
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."); }
|
|
3264
3135
|
|
|
3265
3136
|
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); }
|
|
3266
3137
|
|
|
3267
3138
|
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; }
|
|
3268
3139
|
|
|
3269
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3270
|
-
|
|
3271
|
-
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); } }
|
|
3272
|
-
|
|
3273
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3274
|
-
|
|
3275
3140
|
/**
|
|
3276
3141
|
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
3277
3142
|
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
@@ -3281,104 +3146,86 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
3281
3146
|
|
|
3282
3147
|
var TextPrinterParser = function () {
|
|
3283
3148
|
function TextPrinterParser(field, textStyle, provider) {
|
|
3284
|
-
_classCallCheck(this, TextPrinterParser);
|
|
3285
|
-
|
|
3286
3149
|
this._field = field;
|
|
3287
3150
|
this._textStyle = textStyle;
|
|
3288
3151
|
this._provider = provider;
|
|
3289
3152
|
}
|
|
3290
3153
|
|
|
3291
|
-
|
|
3292
|
-
key: "field",
|
|
3293
|
-
value: function field() {
|
|
3294
|
-
return this._field;
|
|
3295
|
-
}
|
|
3296
|
-
}, {
|
|
3297
|
-
key: "textStyle",
|
|
3298
|
-
value: function textStyle() {
|
|
3299
|
-
return this._textStyle;
|
|
3300
|
-
}
|
|
3301
|
-
}, {
|
|
3302
|
-
key: "provider",
|
|
3303
|
-
value: function provider() {
|
|
3304
|
-
return this._provider;
|
|
3305
|
-
}
|
|
3306
|
-
}, {
|
|
3307
|
-
key: "print",
|
|
3308
|
-
value: function print(context, buf) {
|
|
3309
|
-
var value = context.getValue(this._field);
|
|
3154
|
+
var _proto = TextPrinterParser.prototype;
|
|
3310
3155
|
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3156
|
+
_proto.field = function field() {
|
|
3157
|
+
return this._field;
|
|
3158
|
+
};
|
|
3314
3159
|
|
|
3315
|
-
|
|
3160
|
+
_proto.textStyle = function textStyle() {
|
|
3161
|
+
return this._textStyle;
|
|
3162
|
+
};
|
|
3316
3163
|
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3164
|
+
_proto.provider = function provider() {
|
|
3165
|
+
return this._provider;
|
|
3166
|
+
};
|
|
3320
3167
|
|
|
3321
|
-
|
|
3322
|
-
|
|
3168
|
+
_proto.print = function print(context, buf) {
|
|
3169
|
+
var value = context.getValue(this._field);
|
|
3170
|
+
|
|
3171
|
+
if (value === null) {
|
|
3172
|
+
return false;
|
|
3323
3173
|
}
|
|
3324
|
-
}, {
|
|
3325
|
-
key: "parse",
|
|
3326
|
-
value: function parse(context, parseText, position) {
|
|
3327
|
-
var length = parseText.length;
|
|
3328
3174
|
|
|
3329
|
-
|
|
3330
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]("The position is invalid: ".concat(position));
|
|
3331
|
-
}
|
|
3175
|
+
var text = this._provider.getText(this._field, value, this._textStyle, context.locale());
|
|
3332
3176
|
|
|
3333
|
-
|
|
3177
|
+
if (text === null) {
|
|
3178
|
+
return this._numberPrinterParser().print(context, buf);
|
|
3179
|
+
}
|
|
3334
3180
|
|
|
3335
|
-
|
|
3181
|
+
buf.append(text);
|
|
3182
|
+
return true;
|
|
3183
|
+
};
|
|
3336
3184
|
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
_step;
|
|
3185
|
+
_proto.parse = function parse(context, parseText, position) {
|
|
3186
|
+
var length = parseText.length;
|
|
3340
3187
|
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
var itText = entry.key;
|
|
3188
|
+
if (position < 0 || position > length) {
|
|
3189
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalArgumentException"]("The position is invalid: " + position);
|
|
3190
|
+
}
|
|
3345
3191
|
|
|
3346
|
-
|
|
3347
|
-
return context.setParsedField(this._field, entry.value, position, position + itText.length);
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
} catch (err) {
|
|
3351
|
-
_iterator.e(err);
|
|
3352
|
-
} finally {
|
|
3353
|
-
_iterator.f();
|
|
3354
|
-
}
|
|
3192
|
+
var style = context.isStrict() ? this._textStyle : null;
|
|
3355
3193
|
|
|
3356
|
-
|
|
3357
|
-
|
|
3194
|
+
var it = this._provider.getTextIterator(this._field, style, context.locale());
|
|
3195
|
+
|
|
3196
|
+
if (it != null) {
|
|
3197
|
+
for (var _iterator = _createForOfIteratorHelperLoose(it), _step; !(_step = _iterator()).done;) {
|
|
3198
|
+
var entry = _step.value;
|
|
3199
|
+
var itText = entry.key;
|
|
3200
|
+
|
|
3201
|
+
if (context.subSequenceEquals(itText, 0, parseText, position, itText.length)) {
|
|
3202
|
+
return context.setParsedField(this._field, entry.value, position, position + itText.length);
|
|
3358
3203
|
}
|
|
3359
3204
|
}
|
|
3360
3205
|
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
}, {
|
|
3364
|
-
key: "_numberPrinterParser",
|
|
3365
|
-
value: function _numberPrinterParser() {
|
|
3366
|
-
if (this._currentNumberPrinterParser == null) {
|
|
3367
|
-
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);
|
|
3206
|
+
if (context.isStrict()) {
|
|
3207
|
+
return ~position;
|
|
3368
3208
|
}
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
return this._numberPrinterParser().parse(context, parseText, position);
|
|
3212
|
+
};
|
|
3369
3213
|
|
|
3370
|
-
|
|
3214
|
+
_proto._numberPrinterParser = function _numberPrinterParser() {
|
|
3215
|
+
if (this._currentNumberPrinterParser == null) {
|
|
3216
|
+
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);
|
|
3371
3217
|
}
|
|
3372
|
-
}, {
|
|
3373
|
-
key: "toString",
|
|
3374
|
-
value: function toString() {
|
|
3375
|
-
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
3376
|
-
return "Text(".concat(this._field, ")");
|
|
3377
|
-
}
|
|
3378
3218
|
|
|
3379
|
-
|
|
3219
|
+
return this._currentNumberPrinterParser;
|
|
3220
|
+
};
|
|
3221
|
+
|
|
3222
|
+
_proto.toString = function toString() {
|
|
3223
|
+
if (this._textStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["TextStyle"].FULL) {
|
|
3224
|
+
return "Text(" + this._field + ")";
|
|
3380
3225
|
}
|
|
3381
|
-
|
|
3226
|
+
|
|
3227
|
+
return "Text(" + this._field + "," + this._textStyle + ")";
|
|
3228
|
+
};
|
|
3382
3229
|
|
|
3383
3230
|
return TextPrinterParser;
|
|
3384
3231
|
}();
|
|
@@ -3400,12 +3247,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3400
3247
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
3401
3248
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
3402
3249
|
/* harmony import */ var _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../temporal/WeekFields */ "./src/temporal/WeekFields.js");
|
|
3403
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3404
|
-
|
|
3405
|
-
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); } }
|
|
3406
|
-
|
|
3407
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3408
|
-
|
|
3409
3250
|
/*
|
|
3410
3251
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
3411
3252
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -3416,95 +3257,89 @@ var StringBuilder = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["_"].StringBuilde
|
|
|
3416
3257
|
|
|
3417
3258
|
var WeekFieldsPrinterParser = function () {
|
|
3418
3259
|
function WeekFieldsPrinterParser(letter, count) {
|
|
3419
|
-
_classCallCheck(this, WeekFieldsPrinterParser);
|
|
3420
|
-
|
|
3421
3260
|
this._letter = letter;
|
|
3422
3261
|
this._count = count;
|
|
3423
3262
|
}
|
|
3424
3263
|
|
|
3425
|
-
|
|
3426
|
-
key: "print",
|
|
3427
|
-
value: function print(context, buf) {
|
|
3428
|
-
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
3264
|
+
var _proto = WeekFieldsPrinterParser.prototype;
|
|
3429
3265
|
|
|
3430
|
-
|
|
3266
|
+
_proto.print = function print(context, buf) {
|
|
3267
|
+
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
3431
3268
|
|
|
3432
|
-
|
|
3433
|
-
}
|
|
3434
|
-
}, {
|
|
3435
|
-
key: "parse",
|
|
3436
|
-
value: function parse(context, text, position) {
|
|
3437
|
-
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
3269
|
+
var pp = this._evaluate(weekFields);
|
|
3438
3270
|
|
|
3439
|
-
|
|
3271
|
+
return pp.print(context, buf);
|
|
3272
|
+
};
|
|
3440
3273
|
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
}, {
|
|
3444
|
-
key: "_evaluate",
|
|
3445
|
-
value: function _evaluate(weekFields) {
|
|
3446
|
-
var pp = null;
|
|
3447
|
-
|
|
3448
|
-
switch (this._letter) {
|
|
3449
|
-
case 'e':
|
|
3450
|
-
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);
|
|
3451
|
-
break;
|
|
3452
|
-
|
|
3453
|
-
case 'c':
|
|
3454
|
-
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);
|
|
3455
|
-
break;
|
|
3456
|
-
|
|
3457
|
-
case 'w':
|
|
3458
|
-
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);
|
|
3459
|
-
break;
|
|
3460
|
-
|
|
3461
|
-
case 'W':
|
|
3462
|
-
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);
|
|
3463
|
-
break;
|
|
3464
|
-
|
|
3465
|
-
case 'Y':
|
|
3466
|
-
if (this._count === 2) {
|
|
3467
|
-
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);
|
|
3468
|
-
} else {
|
|
3469
|
-
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);
|
|
3470
|
-
}
|
|
3274
|
+
_proto.parse = function parse(context, text, position) {
|
|
3275
|
+
var weekFields = _temporal_WeekFields__WEBPACK_IMPORTED_MODULE_1__["WeekFields"].of(context.locale());
|
|
3471
3276
|
|
|
3472
|
-
|
|
3473
|
-
}
|
|
3277
|
+
var pp = this._evaluate(weekFields);
|
|
3474
3278
|
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3279
|
+
return pp.parse(context, text, position);
|
|
3280
|
+
};
|
|
3281
|
+
|
|
3282
|
+
_proto._evaluate = function _evaluate(weekFields) {
|
|
3283
|
+
var pp = null;
|
|
3284
|
+
|
|
3285
|
+
switch (this._letter) {
|
|
3286
|
+
case 'e':
|
|
3287
|
+
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);
|
|
3288
|
+
break;
|
|
3289
|
+
|
|
3290
|
+
case 'c':
|
|
3291
|
+
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);
|
|
3292
|
+
break;
|
|
3293
|
+
|
|
3294
|
+
case 'w':
|
|
3295
|
+
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);
|
|
3296
|
+
break;
|
|
3297
|
+
|
|
3298
|
+
case 'W':
|
|
3299
|
+
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);
|
|
3300
|
+
break;
|
|
3301
|
+
|
|
3302
|
+
case 'Y':
|
|
3303
|
+
if (this._count === 2) {
|
|
3304
|
+
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);
|
|
3488
3305
|
} else {
|
|
3489
|
-
|
|
3490
|
-
}
|
|
3491
|
-
} else {
|
|
3492
|
-
if (this._letter === 'c' || this._letter === 'e') {
|
|
3493
|
-
sb.append('DayOfWeek');
|
|
3494
|
-
} else if (this._letter === 'w') {
|
|
3495
|
-
sb.append('WeekOfWeekBasedYear');
|
|
3496
|
-
} else if (this._letter === 'W') {
|
|
3497
|
-
sb.append('WeekOfMonth');
|
|
3306
|
+
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);
|
|
3498
3307
|
}
|
|
3499
3308
|
|
|
3500
|
-
|
|
3501
|
-
|
|
3309
|
+
break;
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
return pp;
|
|
3313
|
+
};
|
|
3314
|
+
|
|
3315
|
+
_proto.toString = function toString() {
|
|
3316
|
+
var sb = new StringBuilder(30);
|
|
3317
|
+
sb.append('Localized(');
|
|
3318
|
+
|
|
3319
|
+
if (this._letter === 'Y') {
|
|
3320
|
+
if (this._count === 1) {
|
|
3321
|
+
sb.append('WeekBasedYear');
|
|
3322
|
+
} else if (this._count === 2) {
|
|
3323
|
+
sb.append('ReducedValue(WeekBasedYear,2,2,2000-01-01)');
|
|
3324
|
+
} else {
|
|
3325
|
+
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);
|
|
3326
|
+
}
|
|
3327
|
+
} else {
|
|
3328
|
+
if (this._letter === 'c' || this._letter === 'e') {
|
|
3329
|
+
sb.append('DayOfWeek');
|
|
3330
|
+
} else if (this._letter === 'w') {
|
|
3331
|
+
sb.append('WeekOfWeekBasedYear');
|
|
3332
|
+
} else if (this._letter === 'W') {
|
|
3333
|
+
sb.append('WeekOfMonth');
|
|
3502
3334
|
}
|
|
3503
3335
|
|
|
3504
|
-
sb.append('
|
|
3505
|
-
|
|
3336
|
+
sb.append(',');
|
|
3337
|
+
sb.append(this._count);
|
|
3506
3338
|
}
|
|
3507
|
-
|
|
3339
|
+
|
|
3340
|
+
sb.append(')');
|
|
3341
|
+
return sb.toString();
|
|
3342
|
+
};
|
|
3508
3343
|
|
|
3509
3344
|
return WeekFieldsPrinterParser;
|
|
3510
3345
|
}();
|
|
@@ -3593,12 +3428,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3593
3428
|
/* harmony import */ var cldr_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cldr_data__WEBPACK_IMPORTED_MODULE_1__);
|
|
3594
3429
|
/* harmony import */ var cldrjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! cldrjs */ "./node_modules/cldrjs/dist/node_main.js");
|
|
3595
3430
|
/* harmony import */ var cldrjs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(cldrjs__WEBPACK_IMPORTED_MODULE_2__);
|
|
3596
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3597
|
-
|
|
3598
|
-
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); } }
|
|
3599
|
-
|
|
3600
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
3601
|
-
|
|
3602
3431
|
/*
|
|
3603
3432
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
3604
3433
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
@@ -3625,9 +3454,27 @@ var _weekDayMap = {
|
|
|
3625
3454
|
'sun': _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"].SUNDAY
|
|
3626
3455
|
};
|
|
3627
3456
|
var ComputedDayOfField = function () {
|
|
3628
|
-
function
|
|
3629
|
-
|
|
3457
|
+
ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
|
|
3458
|
+
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);
|
|
3459
|
+
};
|
|
3460
|
+
|
|
3461
|
+
ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
|
|
3462
|
+
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);
|
|
3463
|
+
};
|
|
3630
3464
|
|
|
3465
|
+
ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
|
|
3466
|
+
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);
|
|
3467
|
+
};
|
|
3468
|
+
|
|
3469
|
+
ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
|
|
3470
|
+
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);
|
|
3471
|
+
};
|
|
3472
|
+
|
|
3473
|
+
ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
|
|
3474
|
+
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);
|
|
3475
|
+
};
|
|
3476
|
+
|
|
3477
|
+
function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
|
|
3631
3478
|
this._name = name;
|
|
3632
3479
|
this._weekDef = weekDef;
|
|
3633
3480
|
this._baseUnit = baseUnit;
|
|
@@ -3635,484 +3482,482 @@ var ComputedDayOfField = function () {
|
|
|
3635
3482
|
this._range = range;
|
|
3636
3483
|
}
|
|
3637
3484
|
|
|
3638
|
-
|
|
3639
|
-
key: "getFrom",
|
|
3640
|
-
value: function getFrom(temporal) {
|
|
3641
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3642
|
-
|
|
3643
|
-
var dow = this._localizedDayOfWeek(temporal, sow);
|
|
3644
|
-
|
|
3645
|
-
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
3646
|
-
return dow;
|
|
3647
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
3648
|
-
return this._localizedWeekOfMonth(temporal, dow);
|
|
3649
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3650
|
-
return this._localizedWeekOfYear(temporal, dow);
|
|
3651
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
3652
|
-
return this._localizedWOWBY(temporal);
|
|
3653
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
3654
|
-
return this._localizedWBY(temporal);
|
|
3655
|
-
} else {
|
|
3656
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
3657
|
-
}
|
|
3658
|
-
}
|
|
3659
|
-
}, {
|
|
3660
|
-
key: "_localizedDayOfWeek",
|
|
3661
|
-
value: function _localizedDayOfWeek(temporal, sow) {
|
|
3662
|
-
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3663
|
-
return MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3664
|
-
}
|
|
3665
|
-
}, {
|
|
3666
|
-
key: "_localizedWeekOfMonth",
|
|
3667
|
-
value: function _localizedWeekOfMonth(temporal, dow) {
|
|
3668
|
-
var dom = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
3669
|
-
|
|
3670
|
-
var offset = this._startOfWeekOffset(dom, dow);
|
|
3485
|
+
var _proto = ComputedDayOfField.prototype;
|
|
3671
3486
|
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
}, {
|
|
3675
|
-
key: "_localizedWeekOfYear",
|
|
3676
|
-
value: function _localizedWeekOfYear(temporal, dow) {
|
|
3677
|
-
var doy = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
3487
|
+
_proto.getFrom = function getFrom(temporal) {
|
|
3488
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3678
3489
|
|
|
3679
|
-
|
|
3490
|
+
var dow = this._localizedDayOfWeek(temporal, sow);
|
|
3680
3491
|
|
|
3681
|
-
|
|
3492
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
3493
|
+
return dow;
|
|
3494
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
3495
|
+
return this._localizedWeekOfMonth(temporal, dow);
|
|
3496
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3497
|
+
return this._localizedWeekOfYear(temporal, dow);
|
|
3498
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
3499
|
+
return this._localizedWOWBY(temporal);
|
|
3500
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
3501
|
+
return this._localizedWBY(temporal);
|
|
3502
|
+
} else {
|
|
3503
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
3682
3504
|
}
|
|
3683
|
-
}
|
|
3684
|
-
key: "_localizedWOWBY",
|
|
3685
|
-
value: function _localizedWOWBY(temporal) {
|
|
3686
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3505
|
+
};
|
|
3687
3506
|
|
|
3688
|
-
|
|
3689
|
-
|
|
3507
|
+
_proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
|
|
3508
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3509
|
+
return MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3510
|
+
};
|
|
3690
3511
|
|
|
3691
|
-
|
|
3512
|
+
_proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
|
|
3513
|
+
var dom = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
3692
3514
|
|
|
3693
|
-
|
|
3694
|
-
var previous = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].from(temporal).minus(1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3695
|
-
return this._localizedWeekOfYear(previous, dow) + 1;
|
|
3696
|
-
} else if (woy >= 53) {
|
|
3697
|
-
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
3515
|
+
var offset = this._startOfWeekOffset(dom, dow);
|
|
3698
3516
|
|
|
3699
|
-
|
|
3700
|
-
|
|
3517
|
+
return ComputedDayOfField._computeWeek(offset, dom);
|
|
3518
|
+
};
|
|
3701
3519
|
|
|
3702
|
-
|
|
3520
|
+
_proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
|
|
3521
|
+
var doy = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
3703
3522
|
|
|
3704
|
-
|
|
3705
|
-
return woy - (weekIndexOfFirstWeekNextYear - 1);
|
|
3706
|
-
}
|
|
3707
|
-
}
|
|
3523
|
+
var offset = this._startOfWeekOffset(doy, dow);
|
|
3708
3524
|
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
}, {
|
|
3712
|
-
key: "_localizedWBY",
|
|
3713
|
-
value: function _localizedWBY(temporal) {
|
|
3714
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3525
|
+
return ComputedDayOfField._computeWeek(offset, doy);
|
|
3526
|
+
};
|
|
3715
3527
|
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3528
|
+
_proto._localizedWOWBY = function _localizedWOWBY(temporal) {
|
|
3529
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3719
3530
|
|
|
3720
|
-
|
|
3531
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3532
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3721
3533
|
|
|
3722
|
-
|
|
3723
|
-
return year - 1;
|
|
3724
|
-
} else if (woy < 53) {
|
|
3725
|
-
return year;
|
|
3726
|
-
}
|
|
3534
|
+
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
3727
3535
|
|
|
3536
|
+
if (woy === 0) {
|
|
3537
|
+
var previous = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].from(temporal).minus(1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3538
|
+
return this._localizedWeekOfYear(previous, dow) + 1;
|
|
3539
|
+
} else if (woy >= 53) {
|
|
3728
3540
|
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
3729
3541
|
|
|
3542
|
+
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3730
3543
|
var yearLen = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Year"].isLeap(year) ? 366 : 365;
|
|
3731
3544
|
|
|
3732
3545
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
3733
3546
|
|
|
3734
3547
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
3735
|
-
return
|
|
3548
|
+
return woy - (weekIndexOfFirstWeekNextYear - 1);
|
|
3736
3549
|
}
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
return woy;
|
|
3553
|
+
};
|
|
3554
|
+
|
|
3555
|
+
_proto._localizedWBY = function _localizedWBY(temporal) {
|
|
3556
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3737
3557
|
|
|
3558
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3559
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3560
|
+
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3561
|
+
|
|
3562
|
+
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
3563
|
+
|
|
3564
|
+
if (woy === 0) {
|
|
3565
|
+
return year - 1;
|
|
3566
|
+
} else if (woy < 53) {
|
|
3738
3567
|
return year;
|
|
3739
3568
|
}
|
|
3740
|
-
}, {
|
|
3741
|
-
key: "_startOfWeekOffset",
|
|
3742
|
-
value: function _startOfWeekOffset(day, dow) {
|
|
3743
|
-
var weekStart = MathUtil.floorMod(day - dow, 7);
|
|
3744
|
-
var offset = -weekStart;
|
|
3745
|
-
|
|
3746
|
-
if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
|
|
3747
|
-
offset = 7 - weekStart;
|
|
3748
|
-
}
|
|
3749
3569
|
|
|
3750
|
-
|
|
3570
|
+
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
3571
|
+
|
|
3572
|
+
var yearLen = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Year"].isLeap(year) ? 366 : 365;
|
|
3573
|
+
|
|
3574
|
+
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
3575
|
+
|
|
3576
|
+
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
3577
|
+
return year + 1;
|
|
3751
3578
|
}
|
|
3752
|
-
}, {
|
|
3753
|
-
key: "adjustInto",
|
|
3754
|
-
value: function adjustInto(temporal, newValue) {
|
|
3755
|
-
var newVal = this._range.checkValidIntValue(newValue, this);
|
|
3756
3579
|
|
|
3757
|
-
|
|
3580
|
+
return year;
|
|
3581
|
+
};
|
|
3758
3582
|
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3583
|
+
_proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
|
|
3584
|
+
var weekStart = MathUtil.floorMod(day - dow, 7);
|
|
3585
|
+
var offset = -weekStart;
|
|
3762
3586
|
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
var result = temporal.plus(diffWeeks, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3587
|
+
if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
|
|
3588
|
+
offset = 7 - weekStart;
|
|
3589
|
+
}
|
|
3767
3590
|
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
result = result.minus(newWowby, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3771
|
-
} else {
|
|
3772
|
-
if (result.get(this) < newVal) {
|
|
3773
|
-
result = result.plus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3774
|
-
}
|
|
3591
|
+
return offset;
|
|
3592
|
+
};
|
|
3775
3593
|
|
|
3776
|
-
|
|
3594
|
+
ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
|
|
3595
|
+
return MathUtil.intDiv(7 + offset + (day - 1), 7);
|
|
3596
|
+
};
|
|
3777
3597
|
|
|
3778
|
-
|
|
3598
|
+
_proto.adjustInto = function adjustInto(temporal, newValue) {
|
|
3599
|
+
var newVal = this._range.checkValidIntValue(newValue, this);
|
|
3779
3600
|
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3601
|
+
var currentVal = temporal.get(this);
|
|
3602
|
+
|
|
3603
|
+
if (newVal === currentVal) {
|
|
3604
|
+
return temporal;
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
3608
|
+
var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
|
|
3609
|
+
var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
|
|
3610
|
+
var result = temporal.plus(diffWeeks, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3611
|
+
|
|
3612
|
+
if (result.get(this) > newVal) {
|
|
3613
|
+
var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
3614
|
+
result = result.minus(newWowby, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3615
|
+
} else {
|
|
3616
|
+
if (result.get(this) < newVal) {
|
|
3617
|
+
result = result.plus(2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3783
3618
|
}
|
|
3784
3619
|
|
|
3785
|
-
|
|
3620
|
+
var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
3621
|
+
|
|
3622
|
+
result = result.plus(baseWowby - _newWowby, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3623
|
+
|
|
3624
|
+
if (result.get(this) > newVal) {
|
|
3625
|
+
result = result.minus(1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS);
|
|
3626
|
+
}
|
|
3786
3627
|
}
|
|
3787
3628
|
|
|
3788
|
-
|
|
3789
|
-
return temporal.plus(delta, this._baseUnit);
|
|
3629
|
+
return result;
|
|
3790
3630
|
}
|
|
3791
|
-
}, {
|
|
3792
|
-
key: "resolve",
|
|
3793
|
-
value: function resolve(fieldValues, partialTemporal, resolverStyle) {
|
|
3794
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3795
3631
|
|
|
3796
|
-
|
|
3797
|
-
|
|
3632
|
+
var delta = newVal - currentVal;
|
|
3633
|
+
return temporal.plus(delta, this._baseUnit);
|
|
3634
|
+
};
|
|
3798
3635
|
|
|
3799
|
-
|
|
3636
|
+
_proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
|
|
3637
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
3800
3638
|
|
|
3801
|
-
|
|
3639
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
3640
|
+
var value = fieldValues.remove(this);
|
|
3802
3641
|
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3642
|
+
var localDow = this._range.checkValidIntValue(value, this);
|
|
3643
|
+
|
|
3644
|
+
var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
|
|
3645
|
+
|
|
3646
|
+
fieldValues.put(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK, _isoDow);
|
|
3647
|
+
return null;
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3650
|
+
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK) === false) {
|
|
3651
|
+
return null;
|
|
3652
|
+
}
|
|
3806
3653
|
|
|
3807
|
-
|
|
3654
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
3655
|
+
if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
|
|
3808
3656
|
return null;
|
|
3809
3657
|
}
|
|
3810
3658
|
|
|
3811
|
-
|
|
3812
|
-
if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
|
|
3813
|
-
return null;
|
|
3814
|
-
}
|
|
3659
|
+
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));
|
|
3815
3660
|
|
|
3816
|
-
|
|
3661
|
+
var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
|
|
3817
3662
|
|
|
3818
|
-
|
|
3663
|
+
var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
|
|
3664
|
+
var date;
|
|
3665
|
+
var days;
|
|
3819
3666
|
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
var
|
|
3667
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].LENIENT) {
|
|
3668
|
+
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
3669
|
+
var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
|
|
3823
3670
|
|
|
3824
|
-
|
|
3825
|
-
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
3826
|
-
var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
|
|
3671
|
+
var dateDow = this._localizedDayOfWeek(date, sow);
|
|
3827
3672
|
|
|
3828
|
-
|
|
3673
|
+
var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
|
|
3829
3674
|
|
|
3830
|
-
|
|
3675
|
+
days = weeks * 7 + (_dow - dateDow);
|
|
3676
|
+
} else {
|
|
3677
|
+
date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
3831
3678
|
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3679
|
+
var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
|
|
3680
|
+
|
|
3681
|
+
var _dateDow = this._localizedDayOfWeek(date, sow);
|
|
3835
3682
|
|
|
3836
|
-
|
|
3683
|
+
var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
|
|
3837
3684
|
|
|
3838
|
-
|
|
3685
|
+
days = _weeks * 7 + (_dow - _dateDow);
|
|
3686
|
+
}
|
|
3839
3687
|
|
|
3840
|
-
|
|
3688
|
+
date = date.plus(days, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS);
|
|
3841
3689
|
|
|
3842
|
-
|
|
3690
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].STRICT) {
|
|
3691
|
+
if (date.getLong(this) !== fieldValues.get(this)) {
|
|
3692
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different year');
|
|
3843
3693
|
}
|
|
3694
|
+
}
|
|
3844
3695
|
|
|
3845
|
-
|
|
3696
|
+
fieldValues.remove(this);
|
|
3697
|
+
fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
|
|
3698
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3699
|
+
return date;
|
|
3700
|
+
}
|
|
3846
3701
|
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
}
|
|
3851
|
-
}
|
|
3702
|
+
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR) === false) {
|
|
3703
|
+
return null;
|
|
3704
|
+
}
|
|
3852
3705
|
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
return date;
|
|
3857
|
-
}
|
|
3706
|
+
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));
|
|
3707
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3708
|
+
var year = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR));
|
|
3858
3709
|
|
|
3859
|
-
|
|
3710
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
3711
|
+
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) === false) {
|
|
3860
3712
|
return null;
|
|
3861
3713
|
}
|
|
3862
3714
|
|
|
3863
|
-
var
|
|
3864
|
-
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3865
|
-
var year = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR.checkValidIntValue(fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR));
|
|
3715
|
+
var _value = fieldValues.remove(this);
|
|
3866
3716
|
|
|
3867
|
-
|
|
3868
|
-
if (fieldValues.containsKey(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR) === false) {
|
|
3869
|
-
return null;
|
|
3870
|
-
}
|
|
3717
|
+
var _date;
|
|
3871
3718
|
|
|
3872
|
-
|
|
3719
|
+
var _days;
|
|
3873
3720
|
|
|
3874
|
-
|
|
3721
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].LENIENT) {
|
|
3722
|
+
var month = fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
3723
|
+
_date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, 1, 1);
|
|
3724
|
+
_date = _date.plus(month - 1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS);
|
|
3875
3725
|
|
|
3876
|
-
var
|
|
3726
|
+
var _dateDow2 = this._localizedDayOfWeek(_date, sow);
|
|
3877
3727
|
|
|
3878
|
-
|
|
3879
|
-
var month = fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
3880
|
-
_date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, 1, 1);
|
|
3881
|
-
_date = _date.plus(month - 1, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS);
|
|
3728
|
+
var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
|
|
3882
3729
|
|
|
3883
|
-
|
|
3730
|
+
_days = _weeks2 * 7 + (dow - _dateDow2);
|
|
3731
|
+
} else {
|
|
3732
|
+
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));
|
|
3884
3733
|
|
|
3885
|
-
|
|
3734
|
+
_date = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, _month, 8);
|
|
3886
3735
|
|
|
3887
|
-
|
|
3888
|
-
} else {
|
|
3889
|
-
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));
|
|
3736
|
+
var _dateDow3 = this._localizedDayOfWeek(_date, sow);
|
|
3890
3737
|
|
|
3891
|
-
|
|
3738
|
+
var wom = this._range.checkValidIntValue(_value, this);
|
|
3892
3739
|
|
|
3893
|
-
|
|
3740
|
+
var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
|
|
3894
3741
|
|
|
3895
|
-
|
|
3742
|
+
_days = _weeks3 * 7 + (dow - _dateDow3);
|
|
3743
|
+
}
|
|
3896
3744
|
|
|
3897
|
-
|
|
3745
|
+
_date = _date.plus(_days, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS);
|
|
3898
3746
|
|
|
3899
|
-
|
|
3747
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].STRICT) {
|
|
3748
|
+
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)) {
|
|
3749
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different month');
|
|
3900
3750
|
}
|
|
3751
|
+
}
|
|
3901
3752
|
|
|
3902
|
-
|
|
3753
|
+
fieldValues.remove(this);
|
|
3754
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3755
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
3756
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3757
|
+
return _date;
|
|
3758
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3759
|
+
var _value2 = fieldValues.remove(this);
|
|
3903
3760
|
|
|
3904
|
-
|
|
3905
|
-
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)) {
|
|
3906
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different month');
|
|
3907
|
-
}
|
|
3908
|
-
}
|
|
3761
|
+
var _date2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDate"].of(year, 1, 1);
|
|
3909
3762
|
|
|
3910
|
-
|
|
3911
|
-
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3912
|
-
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].MONTH_OF_YEAR);
|
|
3913
|
-
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3914
|
-
return _date;
|
|
3915
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3916
|
-
var _value2 = fieldValues.remove(this);
|
|
3763
|
+
var _days2;
|
|
3917
3764
|
|
|
3918
|
-
|
|
3765
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].LENIENT) {
|
|
3766
|
+
var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
|
|
3919
3767
|
|
|
3920
|
-
var
|
|
3768
|
+
var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
|
|
3921
3769
|
|
|
3922
|
-
|
|
3923
|
-
|
|
3770
|
+
_days2 = _weeks4 * 7 + (dow - _dateDow4);
|
|
3771
|
+
} else {
|
|
3772
|
+
var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
|
|
3924
3773
|
|
|
3925
|
-
|
|
3774
|
+
var woy = this._range.checkValidIntValue(_value2, this);
|
|
3926
3775
|
|
|
3927
|
-
|
|
3928
|
-
} else {
|
|
3929
|
-
var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
|
|
3776
|
+
var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
|
|
3930
3777
|
|
|
3931
|
-
|
|
3778
|
+
_days2 = _weeks5 * 7 + (dow - _dateDow5);
|
|
3779
|
+
}
|
|
3932
3780
|
|
|
3933
|
-
|
|
3781
|
+
_date2 = _date2.plus(_days2, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].DAYS);
|
|
3934
3782
|
|
|
3935
|
-
|
|
3783
|
+
if (resolverStyle === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ResolverStyle"].STRICT) {
|
|
3784
|
+
if (_date2.getLong(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR) !== fieldValues.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR)) {
|
|
3785
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Strict mode rejected date parsed to a different year');
|
|
3936
3786
|
}
|
|
3787
|
+
}
|
|
3937
3788
|
|
|
3938
|
-
|
|
3789
|
+
fieldValues.remove(this);
|
|
3790
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3791
|
+
fieldValues.remove(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3792
|
+
return _date2;
|
|
3793
|
+
} else {
|
|
3794
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
3795
|
+
}
|
|
3796
|
+
};
|
|
3939
3797
|
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
}
|
|
3944
|
-
}
|
|
3798
|
+
_proto.name = function name() {
|
|
3799
|
+
return this._name;
|
|
3800
|
+
};
|
|
3945
3801
|
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
return _date2;
|
|
3950
|
-
} else {
|
|
3951
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
3952
|
-
}
|
|
3953
|
-
}
|
|
3954
|
-
}, {
|
|
3955
|
-
key: "name",
|
|
3956
|
-
value: function name() {
|
|
3957
|
-
return this._name;
|
|
3958
|
-
}
|
|
3959
|
-
}, {
|
|
3960
|
-
key: "baseUnit",
|
|
3961
|
-
value: function baseUnit() {
|
|
3962
|
-
return this._baseUnit;
|
|
3963
|
-
}
|
|
3964
|
-
}, {
|
|
3965
|
-
key: "rangeUnit",
|
|
3966
|
-
value: function rangeUnit() {
|
|
3967
|
-
return this._rangeUnit;
|
|
3968
|
-
}
|
|
3969
|
-
}, {
|
|
3970
|
-
key: "range",
|
|
3971
|
-
value: function range() {
|
|
3972
|
-
return this._range;
|
|
3973
|
-
}
|
|
3974
|
-
}, {
|
|
3975
|
-
key: "isDateBased",
|
|
3976
|
-
value: function isDateBased() {
|
|
3977
|
-
return true;
|
|
3978
|
-
}
|
|
3979
|
-
}, {
|
|
3980
|
-
key: "isTimeBased",
|
|
3981
|
-
value: function isTimeBased() {
|
|
3982
|
-
return false;
|
|
3983
|
-
}
|
|
3984
|
-
}, {
|
|
3985
|
-
key: "isSupportedBy",
|
|
3986
|
-
value: function isSupportedBy(temporal) {
|
|
3987
|
-
if (temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK)) {
|
|
3988
|
-
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
3989
|
-
return true;
|
|
3990
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
3991
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
3992
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3993
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
3994
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
3995
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
3996
|
-
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
3997
|
-
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
3998
|
-
}
|
|
3999
|
-
}
|
|
3802
|
+
_proto.baseUnit = function baseUnit() {
|
|
3803
|
+
return this._baseUnit;
|
|
3804
|
+
};
|
|
4000
3805
|
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
}
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
3806
|
+
_proto.rangeUnit = function rangeUnit() {
|
|
3807
|
+
return this._rangeUnit;
|
|
3808
|
+
};
|
|
3809
|
+
|
|
3810
|
+
_proto.range = function range() {
|
|
3811
|
+
return this._range;
|
|
3812
|
+
};
|
|
3813
|
+
|
|
3814
|
+
_proto.isDateBased = function isDateBased() {
|
|
3815
|
+
return true;
|
|
3816
|
+
};
|
|
4009
3817
|
|
|
4010
|
-
|
|
3818
|
+
_proto.isTimeBased = function isTimeBased() {
|
|
3819
|
+
return false;
|
|
3820
|
+
};
|
|
4011
3821
|
|
|
4012
|
-
|
|
4013
|
-
|
|
3822
|
+
_proto.isSupportedBy = function isSupportedBy(temporal) {
|
|
3823
|
+
if (temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK)) {
|
|
3824
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
3825
|
+
return true;
|
|
3826
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
3827
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH);
|
|
4014
3828
|
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
4015
|
-
|
|
3829
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR);
|
|
4016
3830
|
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
4017
|
-
return
|
|
3831
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
4018
3832
|
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
4019
|
-
return temporal.
|
|
4020
|
-
} else {
|
|
4021
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
3833
|
+
return temporal.isSupported(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].EPOCH_DAY);
|
|
4022
3834
|
}
|
|
3835
|
+
}
|
|
4023
3836
|
|
|
4024
|
-
|
|
3837
|
+
return false;
|
|
3838
|
+
};
|
|
4025
3839
|
|
|
4026
|
-
|
|
4027
|
-
|
|
3840
|
+
_proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
|
|
3841
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].WEEKS) {
|
|
3842
|
+
return this._range;
|
|
3843
|
+
}
|
|
4028
3844
|
|
|
4029
|
-
|
|
3845
|
+
var field = null;
|
|
4030
3846
|
|
|
4031
|
-
|
|
4032
|
-
|
|
3847
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].MONTHS) {
|
|
3848
|
+
field = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_MONTH;
|
|
3849
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3850
|
+
field = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR;
|
|
3851
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IsoFields"].WEEK_BASED_YEARS) {
|
|
3852
|
+
return this._rangeWOWBY(temporal);
|
|
3853
|
+
} else if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].FOREVER) {
|
|
3854
|
+
return temporal.range(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3855
|
+
} else {
|
|
3856
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["IllegalStateException"]('unreachable');
|
|
4033
3857
|
}
|
|
4034
|
-
}, {
|
|
4035
|
-
key: "_rangeWOWBY",
|
|
4036
|
-
value: function _rangeWOWBY(temporal) {
|
|
4037
|
-
var sow = this._weekDef.firstDayOfWeek().value();
|
|
4038
3858
|
|
|
4039
|
-
|
|
4040
|
-
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
3859
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
4041
3860
|
|
|
4042
|
-
|
|
3861
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3862
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
4043
3863
|
|
|
4044
|
-
|
|
4045
|
-
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));
|
|
4046
|
-
}
|
|
3864
|
+
var offset = this._startOfWeekOffset(temporal.get(field), dow);
|
|
4047
3865
|
|
|
4048
|
-
|
|
3866
|
+
var fieldRange = temporal.range(field);
|
|
3867
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ValueRange"].of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
|
|
3868
|
+
};
|
|
4049
3869
|
|
|
4050
|
-
|
|
4051
|
-
|
|
3870
|
+
_proto._rangeWOWBY = function _rangeWOWBY(temporal) {
|
|
3871
|
+
var sow = this._weekDef.firstDayOfWeek().value();
|
|
4052
3872
|
|
|
4053
|
-
|
|
3873
|
+
var isoDow = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_WEEK);
|
|
3874
|
+
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
4054
3875
|
|
|
4055
|
-
|
|
4056
|
-
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));
|
|
4057
|
-
}
|
|
3876
|
+
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
4058
3877
|
|
|
4059
|
-
|
|
3878
|
+
if (woy === 0) {
|
|
3879
|
+
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));
|
|
4060
3880
|
}
|
|
4061
|
-
}, {
|
|
4062
|
-
key: "displayName",
|
|
4063
|
-
value: function displayName(locale) {
|
|
4064
|
-
requireNonNull(locale, 'locale');
|
|
4065
3881
|
|
|
4066
|
-
|
|
4067
|
-
return 'Week';
|
|
4068
|
-
}
|
|
3882
|
+
var offset = this._startOfWeekOffset(temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].DAY_OF_YEAR), dow);
|
|
4069
3883
|
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
}], [{
|
|
4078
|
-
key: "ofDayOfWeekField",
|
|
4079
|
-
value: function ofDayOfWeekField(weekDef) {
|
|
4080
|
-
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);
|
|
4081
|
-
}
|
|
4082
|
-
}, {
|
|
4083
|
-
key: "ofWeekOfMonthField",
|
|
4084
|
-
value: function ofWeekOfMonthField(weekDef) {
|
|
4085
|
-
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);
|
|
4086
|
-
}
|
|
4087
|
-
}, {
|
|
4088
|
-
key: "ofWeekOfYearField",
|
|
4089
|
-
value: function ofWeekOfYearField(weekDef) {
|
|
4090
|
-
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);
|
|
4091
|
-
}
|
|
4092
|
-
}, {
|
|
4093
|
-
key: "ofWeekOfWeekBasedYearField",
|
|
4094
|
-
value: function ofWeekOfWeekBasedYearField(weekDef) {
|
|
4095
|
-
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);
|
|
4096
|
-
}
|
|
4097
|
-
}, {
|
|
4098
|
-
key: "ofWeekBasedYearField",
|
|
4099
|
-
value: function ofWeekBasedYearField(weekDef) {
|
|
4100
|
-
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);
|
|
3884
|
+
var year = temporal.get(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoField"].YEAR);
|
|
3885
|
+
var yearLen = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Year"].isLeap(year) ? 366 : 365;
|
|
3886
|
+
|
|
3887
|
+
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
3888
|
+
|
|
3889
|
+
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
3890
|
+
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));
|
|
4101
3891
|
}
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
3892
|
+
|
|
3893
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ValueRange"].of(1, weekIndexOfFirstWeekNextYear - 1);
|
|
3894
|
+
};
|
|
3895
|
+
|
|
3896
|
+
_proto.displayName = function displayName(locale) {
|
|
3897
|
+
requireNonNull(locale, 'locale');
|
|
3898
|
+
|
|
3899
|
+
if (this._rangeUnit === _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ChronoUnit"].YEARS) {
|
|
3900
|
+
return 'Week';
|
|
4106
3901
|
}
|
|
4107
|
-
|
|
3902
|
+
|
|
3903
|
+
return this.toString();
|
|
3904
|
+
};
|
|
3905
|
+
|
|
3906
|
+
_proto.toString = function toString() {
|
|
3907
|
+
return this._name + "[" + this._weekDef.toString() + "]";
|
|
3908
|
+
};
|
|
4108
3909
|
|
|
4109
3910
|
return ComputedDayOfField;
|
|
4110
3911
|
}();
|
|
4111
3912
|
var WeekFieldsCache = new Map();
|
|
4112
3913
|
var WeekFields = function () {
|
|
4113
|
-
function
|
|
4114
|
-
|
|
3914
|
+
WeekFields.of = function of(firstDayOrLocale, minDays) {
|
|
3915
|
+
if (minDays === undefined) {
|
|
3916
|
+
return WeekFields.ofLocale(firstDayOrLocale);
|
|
3917
|
+
} else {
|
|
3918
|
+
return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
|
|
3919
|
+
}
|
|
3920
|
+
};
|
|
3921
|
+
|
|
3922
|
+
WeekFields.ofLocale = function ofLocale(locale) {
|
|
3923
|
+
requireNonNull(locale, 'locale');
|
|
3924
|
+
cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a.load(cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('supplemental/weekData.json'));
|
|
3925
|
+
var cldr = new cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a(locale.localeString());
|
|
3926
|
+
var worldRegion = '001';
|
|
3927
|
+
var weekData = cldr.get('supplemental/weekData');
|
|
3928
|
+
|
|
3929
|
+
var dow = _weekDayMap[weekData.firstDay[locale.country()]];
|
|
3930
|
+
|
|
3931
|
+
if (!dow) {
|
|
3932
|
+
dow = _weekDayMap[weekData.firstDay[worldRegion]];
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
var minDays = weekData.minDays[locale.country()];
|
|
3936
|
+
|
|
3937
|
+
if (!minDays) {
|
|
3938
|
+
minDays = weekData.minDays[worldRegion];
|
|
3939
|
+
}
|
|
3940
|
+
|
|
3941
|
+
return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
|
|
3942
|
+
};
|
|
3943
|
+
|
|
3944
|
+
WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
3945
|
+
requireNonNull(firstDayOfWeek, 'firstDayOfWeek');
|
|
3946
|
+
requireInstance(firstDayOfWeek, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"], 'firstDayOfWeek');
|
|
3947
|
+
requireNonNull(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
3948
|
+
var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
|
|
3949
|
+
var rules = WeekFieldsCache.get(key);
|
|
3950
|
+
|
|
3951
|
+
if (rules == null) {
|
|
3952
|
+
rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
|
|
3953
|
+
WeekFieldsCache.set(key, rules);
|
|
3954
|
+
rules = WeekFieldsCache.get(key);
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
return rules;
|
|
3958
|
+
};
|
|
4115
3959
|
|
|
3960
|
+
function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
4116
3961
|
requireNonNull(firstDayOfWeek, 'firstDayOfWeek');
|
|
4117
3962
|
requireInstance(firstDayOfWeek, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"], 'firstDayOfWeek');
|
|
4118
3963
|
requireNonNull(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
@@ -4131,114 +3976,55 @@ var WeekFields = function () {
|
|
|
4131
3976
|
cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a.load(cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('supplemental/likelySubtags.json'));
|
|
4132
3977
|
}
|
|
4133
3978
|
|
|
4134
|
-
|
|
4135
|
-
key: "firstDayOfWeek",
|
|
4136
|
-
value: function firstDayOfWeek() {
|
|
4137
|
-
return this._firstDayOfWeek;
|
|
4138
|
-
}
|
|
4139
|
-
}, {
|
|
4140
|
-
key: "minimalDaysInFirstWeek",
|
|
4141
|
-
value: function minimalDaysInFirstWeek() {
|
|
4142
|
-
return this._minimalDays;
|
|
4143
|
-
}
|
|
4144
|
-
}, {
|
|
4145
|
-
key: "dayOfWeek",
|
|
4146
|
-
value: function dayOfWeek() {
|
|
4147
|
-
return this._dayOfWeek;
|
|
4148
|
-
}
|
|
4149
|
-
}, {
|
|
4150
|
-
key: "weekOfMonth",
|
|
4151
|
-
value: function weekOfMonth() {
|
|
4152
|
-
return this._weekOfMonth;
|
|
4153
|
-
}
|
|
4154
|
-
}, {
|
|
4155
|
-
key: "weekOfYear",
|
|
4156
|
-
value: function weekOfYear() {
|
|
4157
|
-
return this._weekOfYear;
|
|
4158
|
-
}
|
|
4159
|
-
}, {
|
|
4160
|
-
key: "weekOfWeekBasedYear",
|
|
4161
|
-
value: function weekOfWeekBasedYear() {
|
|
4162
|
-
return this._weekOfWeekBasedYear;
|
|
4163
|
-
}
|
|
4164
|
-
}, {
|
|
4165
|
-
key: "weekBasedYear",
|
|
4166
|
-
value: function weekBasedYear() {
|
|
4167
|
-
return this._weekBasedYear;
|
|
4168
|
-
}
|
|
4169
|
-
}, {
|
|
4170
|
-
key: "equals",
|
|
4171
|
-
value: function equals(other) {
|
|
4172
|
-
if (this === other) {
|
|
4173
|
-
return true;
|
|
4174
|
-
}
|
|
3979
|
+
var _proto2 = WeekFields.prototype;
|
|
4175
3980
|
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
3981
|
+
_proto2.firstDayOfWeek = function firstDayOfWeek() {
|
|
3982
|
+
return this._firstDayOfWeek;
|
|
3983
|
+
};
|
|
4179
3984
|
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
}
|
|
4183
|
-
key: "hashCode",
|
|
4184
|
-
value: function hashCode() {
|
|
4185
|
-
return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
|
|
4186
|
-
}
|
|
4187
|
-
}, {
|
|
4188
|
-
key: "toString",
|
|
4189
|
-
value: function toString() {
|
|
4190
|
-
return "WeekFields[".concat(this._firstDayOfWeek, ",").concat(this._minimalDays, "]");
|
|
4191
|
-
}
|
|
4192
|
-
}], [{
|
|
4193
|
-
key: "of",
|
|
4194
|
-
value: function of(firstDayOrLocale, minDays) {
|
|
4195
|
-
if (minDays === undefined) {
|
|
4196
|
-
return WeekFields.ofLocale(firstDayOrLocale);
|
|
4197
|
-
} else {
|
|
4198
|
-
return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
}, {
|
|
4202
|
-
key: "ofLocale",
|
|
4203
|
-
value: function ofLocale(locale) {
|
|
4204
|
-
requireNonNull(locale, 'locale');
|
|
4205
|
-
cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a.load(cldr_data__WEBPACK_IMPORTED_MODULE_1___default()('supplemental/weekData.json'));
|
|
4206
|
-
var cldr = new cldrjs__WEBPACK_IMPORTED_MODULE_2___default.a(locale.localeString());
|
|
4207
|
-
var worldRegion = '001';
|
|
4208
|
-
var weekData = cldr.get('supplemental/weekData');
|
|
4209
|
-
|
|
4210
|
-
var dow = _weekDayMap[weekData.firstDay[locale.country()]];
|
|
4211
|
-
|
|
4212
|
-
if (!dow) {
|
|
4213
|
-
dow = _weekDayMap[weekData.firstDay[worldRegion]];
|
|
4214
|
-
}
|
|
3985
|
+
_proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
|
|
3986
|
+
return this._minimalDays;
|
|
3987
|
+
};
|
|
4215
3988
|
|
|
4216
|
-
|
|
3989
|
+
_proto2.dayOfWeek = function dayOfWeek() {
|
|
3990
|
+
return this._dayOfWeek;
|
|
3991
|
+
};
|
|
4217
3992
|
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
3993
|
+
_proto2.weekOfMonth = function weekOfMonth() {
|
|
3994
|
+
return this._weekOfMonth;
|
|
3995
|
+
};
|
|
4221
3996
|
|
|
4222
|
-
|
|
3997
|
+
_proto2.weekOfYear = function weekOfYear() {
|
|
3998
|
+
return this._weekOfYear;
|
|
3999
|
+
};
|
|
4000
|
+
|
|
4001
|
+
_proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
|
|
4002
|
+
return this._weekOfWeekBasedYear;
|
|
4003
|
+
};
|
|
4004
|
+
|
|
4005
|
+
_proto2.weekBasedYear = function weekBasedYear() {
|
|
4006
|
+
return this._weekBasedYear;
|
|
4007
|
+
};
|
|
4008
|
+
|
|
4009
|
+
_proto2.equals = function equals(other) {
|
|
4010
|
+
if (this === other) {
|
|
4011
|
+
return true;
|
|
4223
4012
|
}
|
|
4224
|
-
}, {
|
|
4225
|
-
key: "ofFirstDayOfWeekMinDays",
|
|
4226
|
-
value: function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
4227
|
-
requireNonNull(firstDayOfWeek, 'firstDayOfWeek');
|
|
4228
|
-
requireInstance(firstDayOfWeek, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DayOfWeek"], 'firstDayOfWeek');
|
|
4229
|
-
requireNonNull(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
4230
|
-
var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
|
|
4231
|
-
var rules = WeekFieldsCache.get(key);
|
|
4232
|
-
|
|
4233
|
-
if (rules == null) {
|
|
4234
|
-
rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
|
|
4235
|
-
WeekFieldsCache.set(key, rules);
|
|
4236
|
-
rules = WeekFieldsCache.get(key);
|
|
4237
|
-
}
|
|
4238
4013
|
|
|
4239
|
-
|
|
4014
|
+
if (other instanceof WeekFields) {
|
|
4015
|
+
return this.hashCode() === other.hashCode();
|
|
4240
4016
|
}
|
|
4241
|
-
|
|
4017
|
+
|
|
4018
|
+
return false;
|
|
4019
|
+
};
|
|
4020
|
+
|
|
4021
|
+
_proto2.hashCode = function hashCode() {
|
|
4022
|
+
return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
|
|
4023
|
+
};
|
|
4024
|
+
|
|
4025
|
+
_proto2.toString = function toString() {
|
|
4026
|
+
return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
|
|
4027
|
+
};
|
|
4242
4028
|
|
|
4243
4029
|
return WeekFields;
|
|
4244
4030
|
}();
|