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