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