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