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