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