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