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