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