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