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