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