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