@js-joda/extra 0.11.1 → 0.11.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js-joda-extra.esm.js","sources":["../src/assert.js","../src/DayOfMonth.js","../src/DayOfYear.js","../src/Interval.js","../src/LocalDateRange.js","../src/OffsetDate.js","../src/Quarter.js","../src/Temporals.js","../src/YearQuarter.js","../src/YearWeek.js","../src/_init.js","../src/plug.js","../src/js-joda-extra.js"],"sourcesContent":["/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @return {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @return {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, Clock, DateTimeException, IllegalArgumentException, IsoChronology, LocalDate, Month, MonthDay, TemporalAccessor, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A day-of-month in the ISO-8601 calendar system.\n * \n * {@link DayOfMonth} is an immutable date-time object that represents a day-of-month.\n * It is a type-safe way of representing a day-of-month in an application.\n * Any field that can be derived from a day-of-month can be obtained.\n * \n * This class does not store or represent a year, month, time or time-zone.\n * For example, the value '21' can be stored in a {@link DayOfMonth} and\n * would represent the 21st day of any month.\n */\nexport class DayOfMonth extends TemporalAccessor {\n //-----------------------------------------------------------------------\n /**\n * Function overloading for {@link DayOfMonth.now}:\n * - if called with no arguments, {@link DayOfMonth._now0} is executed;\n * - if called with an instance of {@link ZoneId}, then {@link DayOfMonth._nowZoneId} is executed;\n * - if called with an instance of {@link Clock}, then {@link DayOfMonth._nowClock} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {DayOfMonth}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return DayOfMonth._now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return DayOfMonth._nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return DayOfMonth._nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n /**\n * Obtains the current day-of-month from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current day-of-month.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {DayOfMonth} the current day-of-month using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return this.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current day-of-month from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current day-of-month.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {DayOfMonth} the current day-of-month using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return this.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current day-of-month from the specified clock.\n * \n * This will query the specified clock to obtain the current day-of-month.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock dependency injection}.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {DayOfMonth} the current day-of-month, not null\n * @protected\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return DayOfMonth.of(now.dayOfMonth());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfMonth}.\n * \n * A day-of-month object represents one of the 31 days of the month, from 1 to 31.\n *\n * @param {number} dayOfMonth - the day-of-month to represent, from 1 to 31\n * @return {DayOfMonth} the day-of-month, not null\n * @throws {DateTimeException} if the day-of-month is invalid\n */\n static of(dayOfMonth) {\n if (1 <= dayOfMonth && dayOfMonth <= 31) {\n return DayOfMonth.VALUES[dayOfMonth - 1];\n } else {\n throw new DateTimeException(`Invalid value for DayOfMonth: ${dayOfMonth}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfMonth} from a date-time object.\n * \n * This obtains a day-of-month based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link DayOfMonth}.\n * \n * The conversion extracts the {@link ChronoField#DAY_OF_MONTH} day-of-month field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link DayOfMonth.from}.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {DayOfMonth} the day-of-month, not null\n * @throws {DateTimeException} if unable to convert to a {@link DayOfMonth}\n */\n static from(temporal) {\n if (temporal instanceof DayOfMonth) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return DayOfMonth.of(temporal.get(ChronoField.DAY_OF_MONTH));\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain DayOfMonth from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} dayOfMonth the day-of-month to represent, - from 1 to 31.\n * @private\n */\n constructor(dayOfMonth) {\n super();\n this._day = MathUtil.safeToInt(dayOfMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the day-of-month value.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n value() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this day-of-month can be queried for the specified field.\n * If false, then calling the {@link DayOfMonth.range} range,\n * {@link DayOfMonth.get} get and {@link DayOfMonth.getLong} getLong\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * <ul>\n * <li>{@link ChronoField.DAY_OF_MONTH}\n * </ul>\n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this day-of-month, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_MONTH;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-month is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_MONTH) {\n return field.range();\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-month as an `int`.\n * \n * This queries this day-of-month for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported} supported fields will return valid\n * values based on this day-of-month.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-month as a `long`.\n * \n * This queries this day-of-month for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported(TemporalField) supported fields} will return valid\n * values based on this day-of-month.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_MONTH) {\n return this._day;\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year-month is valid for this year.\n * \n * This method checks whether this day and the input year and month form\n * a valid date.\n *\n * @param {YearMonth} yearMonth - the year month to validate, null returns false\n * @return {boolean} true if the year and month are valid for this day\n */\n isValidYearMonth(yearMonth) {\n return yearMonth != null && yearMonth.isValidDay(this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-month using the specified query.\n * \n * This queries this day-of-month using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-month.\n * \n * This returns a temporal object of the same observable type as the input\n * with the day-of-month changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.DAY_OF_MONTH} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisDay.adjustInto(temporal);\n * temporal = temporal.with(thisDay);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }*/\n return temporal.with(ChronoField.DAY_OF_MONTH, this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this day-of-month with a month to create a {@link MonthDay}.\n * \n * This returns a {@link MonthDay} formed from this day and the specified month.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = day.atMonth(month).atYear(year);\n * ```\n * \n * If this day-of-month is invalid for the month then it will be changed\n * to the last valid date for the month.\n *\n * @param {Month | number} month - the month-of-year to use, from 1 (January) to 12 (December), not null\n * @return {MonthDay} the year-month formed from this year and the specified month, not null\n */\n atMonth(month) {\n requireNonNull(month, 'month');\n if (month instanceof Month) {\n return MonthDay.of(month, Math.min(this._day, month.maxLength()));\n } else {\n return MonthDay.of(month, Math.min(this._day, Month.of(month).maxLength()));\n }\n }\n\n /**\n * Combines this day-of-month with a year-month to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this year and the specified year-month.\n * \n * If this day-of-month is invalid for the year-month then it will be changed\n * to the last valid date for the month.\n *\n * @param {YearMonth} yearMonth - the year-month to use, not null\n * @return {LocalDate} the local date formed from this year and the specified year-month, not null\n */\n atYearMonth(yearMonth) {\n requireNonNull(yearMonth, 'yearMonth');\n return yearMonth.atDay(Math.min(this._day, yearMonth.lengthOfMonth()));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this day-of-month to another.\n * \n * The comparison is based on the value of the day.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param {DayOfMonth} other - the other day-of-month instance, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfMonth, 'other');\n return this._day - other._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this day-of-month is equal to another day-of-month.\n *\n * @param {*} obj - the other day-of-month instance, null returns false\n * @return {boolean} true if the day-of-month is the same\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof DayOfMonth) {\n return this._day === obj._day;\n }\n return false;\n }\n\n /**\n * A hash code for this day-of-month.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this day-of-month as a {@link String}.\n *\n * @return {string} a string representation of this day-of-month, not null\n */\n toString() {\n return `DayOfMonth:${this._day}`;\n }\n\n}\n\nexport function _init() {\n /**\n * Cache of singleton instances.\n */\n DayOfMonth.VALUES = new Array(31);\n for (let i = 0; i < 31; i++) {\n DayOfMonth.VALUES[i] = new DayOfMonth(i + 1);\n }\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, Clock, DateTimeException, IllegalArgumentException, IsoChronology, LocalDate, TemporalAccessor, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, Year, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A day-of-year in the ISO-8601 calendar system.\n * \n * {@link DayOfYear} is an immutable date-time object that represents a day-of-year.\n * It is a type-safe way of representing a day-of-year in an application.\n * Any field that can be derived from a day-of-year can be obtained.\n * \n * This class does not store or represent a year, month, time or time-zone.\n * For example, the value \"51\" can be stored in a {@link DayOfYear} and\n * would represent the 51st day of any year.\n */\nexport class DayOfYear extends TemporalAccessor {\n /**\n * Function overloading for {@link DayOfYear.now}:\n * - if called with no arguments, {@link DayOfYear._now0} is executed;\n * - if called with an instance of {@link ZoneId}, then {@link DayOfYear._nowZoneId} is executed;\n * - if called with an instance of {@link Clock}, then {@link DayOfYear._nowClock} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {DayOfYear}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return DayOfYear._now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return DayOfYear._nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return DayOfYear._nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current day-of-year from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current day-of-year.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {DayOfYear} the current day-of-year using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return DayOfYear.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current day-of-year from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current day-of-year.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {DayOfYear} the current day-of-year using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return DayOfYear.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current day-of-year from the specified clock.\n * \n * This will query the specified clock to obtain the current day-of-year.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {DayOfYear} the current day-of-year, not null\n * @protected\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return DayOfYear.of(now.dayOfYear());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfYear}.\n * \n * A day-of-year object represents one of the 366 days of the year, from 1 to 366.\n *\n * @param {number} dayOfYear - the day-of-year to represent, from 1 to 366\n * @return {DayOfYear} the day-of-year, not null\n * @throws {DateTimeException} if the day-of-year is invalid\n */\n static of(dayOfYear) {\n if (1 <= dayOfYear && dayOfYear <= 366) {\n return DayOfYear.VALUES[dayOfYear - 1];\n } else {\n throw new DateTimeException(`Invalid value for DayOfYear: ${dayOfYear}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfYear} from a date-time object.\n * \n * This obtains a day-of-year based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link DayOfYear}.\n * \n * The conversion extracts the {@link ChronoField.DAY_OF_YEAR} day-of-year field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link DayOfYear.from}.\n *\n * @param {Temporal} temporal - the temporal object to convert, not null\n * @return {DayOfYear} the day-of-year, not null\n * @throws {DateTimeException} if unable to convert to a {@link DayOfYear}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof DayOfYear) {\n return temporal;\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return DayOfYear.of(temporal.get(ChronoField.DAY_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain DayOfYear from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n \n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} dayOfYear - the day-of-year being represented, from 1 to 366.\n * @private\n */\n constructor(dayOfYear) {\n super();\n this._day = MathUtil.safeToInt(dayOfYear);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the day-of-year value.\n *\n * @return {number} the day-of-year, from 1 to 366\n */\n value() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this day-of-year can be queried for the specified field.\n * If false, then calling the {@link DayOfYear.range} range,\n * {@link DayOfYear.get} get and {@link DayOfYear.getLong} getLong\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * - {@link ChronoField.DAY_OF_YEAR}\n * \n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this day-of-year, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_YEAR;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-year is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@code ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_YEAR) {\n return field.range();\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-year as an `int`.\n * \n * This queries this day-of-year for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return valid\n * values based on this day-of-year.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-year as a `long`.\n * \n * This queries this day-of-year for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return valid\n * values based on this day-of-year.\n * All other {@code ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_YEAR) {\n return this._day;\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is valid for this day-of-year.\n * \n * This method checks whether this day-of-yearand the input year form\n * a valid date. This can only return false for day-of-year 366.\n *\n * @param {number} year - the year to validate\n * @return {boolean} true if the year is valid for this day-of-year\n */\n isValidYear(year) {\n return (this._day < 366 || Year.isLeap(year));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-year using the specified query.\n * \n * This queries this day-of-year using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-year.\n * \n * This returns a temporal object of the same observable type as the input\n * with the day-of-year changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.DAY_OF_YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisDay.adjustInto(temporal);\n * temporal = temporal.with(thisDay);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException(\"Adjustment only supported on ISO date-time\");\n }*/\n return temporal.with(ChronoField.DAY_OF_YEAR, this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this day-of-year with a year to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this day and the specified year.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = day.atYear(year);\n * ```\n * \n * The day-of-year value 366 is only valid in a leap year.\n *\n * @param {Year|number} year - the year to use ({@link Year} or `int`), not null\n * @return {LocalDate} the local date formed from this day and the specified year, not null\n * @throws {DateTimeException} if the year is invalid or this is day 366 and the year is not a leap year\n */\n atYear(year) {\n requireNonNull(year, 'year');\n if (year instanceof Year) {\n return year.atDay(this._day);\n } else {\n return LocalDate.ofYearDay(year, this._day);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this day-of-year to another.\n * \n * The comparison is based on the value of the day.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {DayOfYear} other - the other day-of-year instance, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfYear, 'other');\n return this._day - other._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this day-of-year is equal to another day-of-year.\n *\n * @param {*} obj - the other day-of-year instance, null returns false\n * @return {boolean} true if the day-of-year is the same\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof DayOfYear) {\n return this._day === obj._day;\n }\n return false;\n }\n\n /**\n * A hash code for this day-of-year.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this day-of-year as a {@link String}.\n *\n * @return {string} a string representation of this day-of-year, not null\n */\n toString() {\n return `DayOfYear:${this._day}`;\n }\n}\n\nexport function _init() {\n /**\n * Cache of singleton instances.\n */\n DayOfYear.VALUES = new Array(366);\n for (let i = 0; i < 366; i++) {\n DayOfYear.VALUES[i] = new DayOfYear(i + 1);\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * \n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * \n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * \n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n * - If called without arguments, then {@link Interval.ofInstantInstant} is executed.\n * - If called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n * - Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {Instant} startInstant\n * @param {Instant|Duration} endInstantOrDuration\n * @return {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of `Interval` from the start and end instant.\n * \n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive - the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive - the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws {DateTimeException} if the end is before the start\n * @protected\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of `Interval` from the start and a duration.\n * \n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive - the start instant, inclusive, not null\n * @param {Duration} duration - the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws {DateTimeException} if the end is before the start,\n * or if the duration addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs when adding the duration\n * @protected\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of `Interval` from a text string such as\n * `2007-12-03T10:15:30Z/2007-12-04T10:15:30Z`, where the end instant is exclusive.\n * \n * The string must consist of one of the following three formats:\n * - a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * - a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * - a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text - the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive - the start instant, inclusive, validated not null\n * @param {Instant} endExclusive - the end instant, exclusive, validated not null\n * @private\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * \n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * \n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * \n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start - the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws {DateTimeException} if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end - the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws {DateTimeException} if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * \n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then `contains(Instant.MIN)` returns true.\n * If this range has an unbounded end then `contains(Instant.MAX)` returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant - the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * \n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other - the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * \n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other - the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * \n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * \n * This is equivalent to `(overlaps(other) || abuts(other))`.\n *\n * @param {Interval} other - the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * \n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * \n * This is equivalent to `(isConnected(other) && !abuts(other))`.\n *\n * @param {Interval} other - the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * \n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other - the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws {DateTimeException} if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * \n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other - the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws {DateTimeException} if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * \n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other - the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Function overloading for {@link Interval#isAfter}\n * - If called with an Instant, then {@link Interval#isAfterInstant} is executed.\n * - Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {Instant|Interval} instantOrInterval\n * @return {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * Function overloading for {@link Interval#isBefore}\n * - If called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n * - Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {Instant|Interval} instantOrInterval\n * @return {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * \n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant - the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * \n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant - the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * \n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval - the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * \n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval - the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * \n * An `Interval` is associated with two specific instants on the time-line.\n * A `Duration` is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws {ArithmeticException} if the calculation exceeds the capacity of `Duration`\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * \n * Compares this `Interval` with another ensuring that the two instants are the same.\n * Only objects of type `Interval` are compared, other types return false.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a `String`, such as `2007-12-03T10:15:30/2007-12-04T10:15:30`.\n * \n * The output will be the ISO-8601 format formed by combining the\n * `toString()` methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ArithmeticException, DateTimeException, DateTimeParseException, IllegalArgumentException, LocalDate, Period } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\n\n/**\n * The day after the MIN date.\n */\nconst MINP1 = LocalDate.MIN.plusDays(1);\n/**\n * The day before the MAX date.\n */\nconst MAXM1 = LocalDate.MAX.minusDays(1);\n\n/**\n * A range of local dates.\n * \n * A `LocalDateRange` represents a range of dates, from a start date to an end date.\n * Instances can be constructed from either a half-open or a closed range of dates.\n * Internally, the class stores the start and end dates, with the start inclusive and the end exclusive.\n * The end date is always greater than or equal to the start date.\n * \n * The constants `LocalDate.MIN` and `LocalDate.MAX` can be used\n * to indicate an unbounded far-past or far-future. Note that there is no difference\n * between a half-open and a closed range when the end is `LocalDate.MAX`.\n * Empty ranges are allowed.\n * \n * No range can end at `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n * No range can start at `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * No empty range can exist at `LocalDate.MIN` or `LocalDate.MAX`.\n * \n * Date ranges are not comparable. To compare the length of two ranges, it is\n * generally recommended to compare the number of days they contain.\n *\n */\nexport class LocalDateRange {\n /**\n * function overloading for {@link LocalDateRange.of}\n * - if called with `LocalDate` and `LocalDate`, {@link LocalDateRange._ofLocalDateLocalDate} is executed,\n * - if called with `LocalDate` and `Period`, {@link LocalDateRange._ofLocalDatePeriod} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @param {LocalDate} startInclusive\n * @param {LocalDate|Period} endExclusiveOrPeriod\n * @return {LocalDateRange}\n */\n static of(startInclusive, endExclusiveOrPeriod) {\n if (startInclusive instanceof LocalDate && endExclusiveOrPeriod instanceof LocalDate) {\n return LocalDateRange._ofLocalDateLocalDate(startInclusive, endExclusiveOrPeriod);\n }\n if (startInclusive instanceof LocalDate && endExclusiveOrPeriod instanceof Period) {\n return LocalDateRange._ofLocalDatePeriod(startInclusive, endExclusiveOrPeriod);\n }\n const messageParts = [];\n if (!(startInclusive instanceof LocalDate)) {\n messageParts.push(`startInclusive must be an instance of LocalDate but is ${startInclusive.constructor.name}`);\n }\n if (!(endExclusiveOrPeriod instanceof LocalDate || endExclusiveOrPeriod instanceof Period)) {\n messageParts.push(`endExclusiveOrPeriod must be an instance of LocalDate or Period but is ${endExclusiveOrPeriod.constructor.name}`);\n }\n throw new IllegalArgumentException(messageParts.join(' and '));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a half-open range of dates, including the start and excluding the end.\n * \n * The range includes the start date and excludes the end date, unless the end is `LocalDate.MAX`.\n * The end date must be equal to or after the start date.\n * This definition permits an empty range located at a specific date.\n * \n * The constants `LocalDate.MIN` and `LocalDate.MAX` can be used\n * to indicate an unbounded far-past or far-future.\n * \n * The start inclusive date must not be `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * The end inclusive date must not be `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n * No empty range can exist at `LocalDate.MIN` or `LocalDate.MAX`.\n *\n * @param {LocalDate} startInclusive - the inclusive start date, not null\n * @param {LocalDate} endExclusive - the exclusive end date, not null\n * @return {LocalDateRange} the half-open range, not null\n * @throws {DateTimeException} if the end is before the start,\n * or the start date is `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`,\n * or the end date is `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`\n * @protected\n */\n static _ofLocalDateLocalDate(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(endExclusive, LocalDate, 'endExclusive');\n return new LocalDateRange(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of `LocalDateRange` from the start and a period.\n * \n * The end date is calculated as the start plus the duration.\n * The period must not be negative.\n * \n * The constant `LocalDate.MIN` can be used to indicate an unbounded far-past.\n * \n * The period must not be zero or one day when the start date is `LocalDate.MIN`.\n *\n * @param {LocalDate} startInclusive - the inclusive start date, not null\n * @param {Period} period - the period from the start to the end, not null\n * @return {LocalDateRange} the range, not null\n * @throws {DateTimeException} if the end is before the start,\n * or if the period addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs when adding the period\n * @protected\n */\n static _ofLocalDatePeriod(startInclusive, period) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(period, 'period');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(period, Period, 'period');\n if (period.isNegative()) {\n throw new DateTimeException('Period must not be zero or negative');\n }\n return new LocalDateRange(startInclusive, startInclusive.plus(period));\n }\n\n /**\n * Obtains a closed range of dates, including the start and end.\n * \n * The range includes the start date and the end date.\n * The end date must be equal to or after the start date.\n * \n * The constants `LocalDate.MIN` and `LocalDate.MAX` can be used\n * to indicate an unbounded far-past or far-future. In addition, an end date of\n * `LocalDate.MAX.minusDays(1)` will also create an unbounded far-future range.\n * \n * The start inclusive date must not be `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * The end inclusive date must not be `LocalDate.MIN`.\n * \n * @param {LocalDate} startInclusive - the inclusive start date, not null\n * @param {LocalDate} endInclusive - the inclusive end date, not null\n * @return {LocalDateRange} the closed range\n * @throws {DateTimeException} if the end is before the start,\n * or the start date is `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`,\n * or the end date is `LocalDate.MIN`\n */\n static ofClosed(startInclusive, endInclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endInclusive, 'endInclusive');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(endInclusive, LocalDate, 'endInclusive');\n if (endInclusive.isBefore(startInclusive)) {\n throw new DateTimeException('Start date must be on or before end date');\n }\n const end = (endInclusive.equals(LocalDate.MAX) ? LocalDate.MAX : endInclusive.plusDays(1));\n return new LocalDateRange(startInclusive, end);\n }\n\n /**\n * Obtains an empty date range located at the specified date.\n * \n * The empty range has zero length and contains no other dates or ranges.\n * An empty range cannot be located at `LocalDate.MIN`, `LocalDate.MIN.plusDays(1)`,\n * `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n *\n * @param {LocalDate} date - the date where the empty range is located, not null\n * @return {LocalDateRange} the empty range, not null\n * @throws {DateTimeException} if the date is `LocalDate.MIN`, `LocalDate.MIN.plusDays(1)`,\n * `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`\n */\n static ofEmpty(date) {\n requireNonNull(date, 'date');\n requireInstance(date, LocalDate, 'date');\n return new LocalDateRange(date, date);\n }\n\n /**\n * Obtains a range that is unbounded at the start and end.\n * \n * @return {LocalDateRange} the range, with an unbounded start and unbounded end\n */\n static ofUnbounded() {\n return LocalDateRange.ALL;\n }\n\n /**\n * Obtains a range up to, but not including, the specified end date.\n * \n * The range includes all dates from the unbounded start, denoted by `LocalDate.MIN`, to the end date.\n * The end date is exclusive and cannot be `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n * \n * @param {LocalDate} endExclusive - the exclusive end date, `LocalDate.MAX` treated as unbounded, not null\n * @return {LocalDateRange} the range, with an unbounded start\n * @throws {DateTimeException} if the end date is `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`\n */\n static ofUnboundedStart(endExclusive) {\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(endExclusive, LocalDate, 'endExclusive');\n return LocalDateRange.of(LocalDate.MIN, endExclusive);\n }\n\n /**\n * Obtains a range from and including the specified start date.\n * \n * The range includes all dates from the start date to the unbounded end, denoted by `LocalDate.MAX`.\n * The start date is inclusive and cannot be `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * \n * @param {LocalDate} startInclusive - the inclusive start date, `LocalDate.MIN` treated as unbounded, not null\n * @return {LocalDateRange} the range, with an unbounded end\n * @throws {DateTimeException} if the start date is `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`\n */\n static ofUnboundedEnd(startInclusive) {\n return LocalDateRange.of(startInclusive, LocalDate.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `LocalDateRange` from a text string such as\n * `2007-12-03/2007-12-04`, where the end date is exclusive.\n * \n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link LocalDate}, followed by a forward slash,\n * followed by a representation of a {@link LocalDate}\n * <li>a representation of an {@link LocalDate}, followed by a forward slash,\n * followed by a representation of a {@link Period}\n * <li>a representation of a {@link Period}, followed by a forward slash,\n * followed by a representation of an {@link LocalDate}\n * </ul>\n *\n * @param {string} text - the text to parse, not null\n * @return {LocalDateRange} the parsed range, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n for (let i = 0; i < text.length; i++) {\n if (text[i] === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // period followed by date\n const duration = Period.parse(text.slice(0, i));\n const end = LocalDate.parse(text.slice(i + 1, text.length));\n return LocalDateRange.of(end.minus(duration), end);\n } else {\n // date followed by date or period\n const start = LocalDate.parse(text.slice(0, i));\n if (i + 1 < text.length) {\n const c = text[i + 1];\n if (c === 'P' || c === 'p') {\n const duration = Period.parse(text.slice(i + 1, text.length));\n return LocalDateRange.of(start, start.plus(duration));\n }\n }\n const end = LocalDate.parse(text.slice(i + 1, text.length));\n return LocalDateRange.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('LocalDateRange cannot be parsed, no forward slash found', text, 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDate} startInclusive - the start date, inclusive, validated not null\n * @param {LocalDate} endExclusive - the end date, exclusive, validated not null\n * @private\n */\n constructor(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(endExclusive, LocalDate, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End date must be on or after start date');\n }\n if (startInclusive.equals(MAXM1)) {\n throw new DateTimeException('Range must not start at LocalDate.MAX.minusDays(1)');\n }\n if (endExclusive.equals(MINP1)) {\n throw new DateTimeException('Range must not end at LocalDate.MIN.plusDays(1)');\n }\n if (endExclusive.equals(LocalDate.MIN) || startInclusive.equals(LocalDate.MAX)) {\n throw new DateTimeException('Empty range must not be at LocalDate.MIN or LocalDate.MAX');\n }\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start date of this range, inclusive.\n * \n * This will return `LocalDate#MIN` if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n * \n * This never returns `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n *\n * @return {LocalDate} the start date\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end date of this range, exclusive.\n * \n * This will return `LocalDate.MAX` if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n * \n * This never returns `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n *\n * @return {LocalDate} the end date, exclusive\n */\n end() {\n return this._end;\n }\n\n /**\n * Gets the end date of this range, inclusive.\n * \n * This will return `LocalDate.MAX` if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n * \n * This returns the date before the end date.\n * \n * This never returns `LocalDate.MIN`.\n * \n * @return {LocalDate} the end date, inclusive\n */\n endInclusive() {\n if (this.isUnboundedEnd()) {\n return LocalDate.MAX;\n }\n return this._end.minusDays(1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * \n * An empty range occurs when the start date equals the end date.\n * \n * An empty range is never unbounded.\n * \n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the range is unbounded.\n * \n * An unbounded range is never empty.\n * \n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(LocalDate.MIN);\n }\n\n /**\n * Checks if the end of the range is unbounded.\n * \n * An unbounded range is never empty.\n * \n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(LocalDate.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the start date adjusted.\n * \n * This returns a new instance with the start date altered.\n * Since `LocalDate` implements `TemporalAdjuster` any\n * local date can simply be passed in.\n * \n * For example, to adjust the start to one week earlier:\n * <pre>\n * range = range.withStart(date -> date.minus(1, ChronoUnit.WEEKS));\n * </pre>\n * \n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalDateRange} a copy of this range with the start date adjusted\n * @throws {DateTimeException} if the new start date is after the current end date\n */\n withStart(adjuster) {\n return LocalDateRange.of(this._start.with(adjuster), this._end);\n }\n\n /**\n * Returns a copy of this range with the end date adjusted.\n * \n * This returns a new instance with the exclusive end date altered.\n * Since `LocalDate` implements `TemporalAdjuster` any\n * local date can simply be passed in.\n * \n * For example, to adjust the end to one week later:\n * <pre>\n * range = range.withEnd(date -> date.plus(1, ChronoUnit.WEEKS));\n * </pre>\n * \n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalDateRange} a copy of this range with the end date adjusted\n * @throws {DateTimeException} if the new end date is before the current start date\n */\n withEnd(adjuster) {\n return LocalDateRange.of(this._start, this._end.with(adjuster));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range contains the specified date.\n * \n * This checks if the specified date is within the bounds of this range.\n * If this range is empty then this method always returns false.\n * Else if this range has an unbounded start then `contains(LocalDate#MIN)` returns true.\n * Else if this range has an unbounded end then `contains(LocalDate#MAX)` returns true.\n * \n * @param {LocalDate} date - the date to check for, not null\n * @return {boolean} true if this range contains the date\n */\n contains(date) {\n requireNonNull(date, 'date');\n return this._start.compareTo(date) <= 0 && (date.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this range encloses the specified range.\n * \n * This checks if the bounds of the specified range are within the bounds of this range.\n * An empty range encloses itself.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {boolean} true if this range contains all dates in the other range\n */\n encloses(other) {\n requireNonNull(other, 'other');\n return this._start.compareTo(other._start) <= 0 && other._end.compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this range abuts the specified range.\n * \n * The result is true if the end of this range is the start of the other, or vice versa.\n * An empty range does not abut itself.\n *\n * @param {LocalDateRange} other - the other range, not null\n * @return {boolean} true if this range abuts the other range\n */\n abuts(other) {\n requireNonNull(other, 'other');\n return this._end.equals(other._start) !== this._start.equals(other._end);\n }\n\n /**\n * Checks if this range is connected to the specified range.\n * \n * The result is true if the two ranges have an enclosed range in common, even if that range is empty.\n * An empty range is connected to itself.\n * \n * This is equivalent to `(overlaps(other) || abuts(other))`.\n *\n * @param {LocalDateRange} other - the other range, not null\n * @return {boolean} true if this range is connected to the other range\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n return this.equals(other) || (this._start.compareTo(other._end) <= 0 && other._start.compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this range overlaps the specified range.\n * \n * The result is true if the two ranges share some part of the time-line.\n * An empty range overlaps itself.\n * \n * This is equivalent to `(isConnected(other) && !abuts(other))`.\n *\n * @param {LocalDateRange} other - the time range to compare to, null means a zero length range now\n * @return {boolean} true if the time ranges overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n return other.equals(this) || (this._start.compareTo(other._end) < 0 && other._start.compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the range that is the intersection of this range and the specified range.\n * \n * This finds the intersection of two ranges.\n * This throws an exception if the two ranges are not {@linkplain #isConnected(LocalDateRange) connected}.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {LocalDateRange} the range that is the intersection of the two ranges\n * @throws {DateTimeException} if the ranges do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Ranges do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other._start);\n const cmpEnd = this._end.compareTo(other._end);\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other._start);\n const newEnd = (cmpEnd <= 0 ? this._end : other._end);\n return LocalDateRange.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the range that is the union of this range and the specified range.\n * \n * This finds the union of two ranges.\n * This throws an exception if the two ranges are not {@linkplain #isConnected(LocalDateRange) connected}.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {LocalDateRange} the range that is the union of the two ranges\n * @throws {DateTimeException} if the ranges do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Ranges do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other._start);\n const cmpEnd = this._end.compareTo(other._end);\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other._start : this._start);\n const newEnd = (cmpEnd <= 0 ? other._end : this._end);\n return LocalDateRange.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest range that encloses this range and the specified range.\n * \n * The result of this method will {@linkplain #encloses(LocalDateRange) enclose}\n * this range and the specified range.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {LocalDateRange} the range that spans the two ranges\n */\n span(other) {\n requireNonNull(other, 'other');\n const cmpStart = this._start.compareTo(other._start);\n const cmpEnd = this._end.compareTo(other._end);\n const newStart = (cmpStart >= 0 ? other._start : this._start);\n const newEnd = (cmpEnd <= 0 ? other._end : this._end);\n return LocalDateRange.of(newStart, newEnd);\n }\n\n /**\n * Function overloading for {@link LocalDateRange.isAfter}\n * - if called with `LocalDate`, {@link LocalDateRange._isAfterLocalDate} is executed,\n * - if called with `LocalDateRange`, {@link LocalDateRange._isAfterLocalDateRange} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @param {LocalDate|LocalDateRange} localDateOrLocalDateRange\n * @return {boolean}\n */\n isAfter(localDateOrLocalDateRange) {\n if (localDateOrLocalDateRange instanceof LocalDate) {\n return this._isAfterLocalDate(localDateOrLocalDateRange);\n }\n if (localDateOrLocalDateRange instanceof LocalDateRange) {\n return this._isAfterLocalDateRange(localDateOrLocalDateRange);\n }\n throw new IllegalArgumentException(`localDateOrLocalDateRange must be an instance of LocalDate or LocalDateRange but is ${localDateOrLocalDateRange.constructor.name}`);\n }\n\n /**\n * Function overloading for {@link LocalDateRange.isBefore}\n * - if called with `LocalDate`, {@link LocalDateRange._isBeforeLocalDate} is executed,\n * - if called with `LocalDateRange`, {@link LocalDateRange._isBeforeLocalDateRange} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @param {LocalDate|LocalDateRange} localDateOrLocalDateRange\n * @return {boolean}\n */\n isBefore(localDateOrLocalDateRange) {\n if (localDateOrLocalDateRange instanceof LocalDate) {\n return this._isBeforeLocalDate(localDateOrLocalDateRange);\n }\n if (localDateOrLocalDateRange instanceof LocalDateRange) {\n return this._isBeforeLocalDateRange(localDateOrLocalDateRange);\n }\n throw new IllegalArgumentException(`localDateOrLocalDateRange must be an instance of LocalDate or LocalDateRange but is ${localDateOrLocalDateRange.constructor.name}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range is after the specified date.\n * \n * The result is true if every date in this range is after the specified date.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDate} date - the other date to compare to, not null\n * @return {boolean} true if the start of this range is after the specified date\n * @protected\n */\n _isAfterLocalDate(date) {\n return this._start.compareTo(date) > 0;\n }\n\n /**\n * Checks if this range is before the specified date.\n * \n * The result is true if every date in this range is before the specified date.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDate} date - the other date to compare to, not null\n * @return {boolean} true if the start of this range is before the specified date\n * @protected\n */\n _isBeforeLocalDate(date) {\n return this._end.compareTo(date) <= 0 && this._start.compareTo(date) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range is after the specified range.\n * \n * The result is true if every date in this range is after every date in the specified range.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDateRange} other - the other range to compare to, not null\n * @return {boolean} true if every date in this range is after every date in the other range\n * @protected\n */\n _isAfterLocalDateRange(other) {\n return this._start.compareTo(other._end) >= 0 && !other.equals(this);\n }\n\n /**\n * Checks if this range is before the specified range.\n * \n * The result is true if every date in this range is before every date in the specified range.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDateRange} range - the other range to compare to, not null\n * @return {boolean} true if every date in this range is before every date in the other range\n * @protected\n */\n _isBeforeLocalDateRange(range) {\n return this._end.compareTo(range._start) <= 0 && !range.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the length of this range in days.\n * \n * This returns the number of days between the start and end dates.\n * Unbounded ranges return `Number.POSITIVE_INFINITY`.\n *\n * @return {number} the length in days, `Number.POSITIVE_INFINITY` if unbounded\n */\n lengthInDays() {\n if (this.isUnboundedStart() || this.isUnboundedEnd()) {\n return Number.POSITIVE_INFINITY;\n }\n return this._end.toEpochDay() - this._start.toEpochDay();\n }\n\n /**\n * Obtains the length of this range as a period.\n * \n * This returns the {@link Period} between the start and end dates.\n * Unbounded ranges throw {@link ArithmeticException}.\n *\n * @return {Period} the period of the range\n * @throws {ArithmeticException} if the calculation exceeds the capacity of `Period`,\n * or the range is unbounded\n */\n toPeriod() {\n if (this.isUnboundedStart() || this.isUnboundedEnd()) {\n throw new ArithmeticException('Unbounded range cannot be converted to a Period');\n }\n return Period.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range is equal to another range.\n * \n * Compares this `LocalDateRange` with another ensuring that the two dates are the same.\n * Only objects of type `LocalDateRange` are compared, other types return false.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other range\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof LocalDateRange) {\n const other = obj;\n return this._start.equals(other._start) && this._end.equals(other._end);\n }\n return false;\n }\n\n /**\n * A hash code for this range.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this range as a `String`, such as `2007-12-03/2007-12-04`.\n * \n * The output will be the ISO-8601 format formed by combining the\n * `toString()` methods of the two dates, separated by a forward slash.\n *\n * @return {string} a string representation of this date, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n /**\n * A range over the whole time-line.\n */\n LocalDateRange.ALL = new LocalDateRange(LocalDate.MIN, LocalDate.MAX);\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, ChronoUnit, Clock, DateTimeException, DateTimeFormatter, IllegalArgumentException, IsoChronology, LocalDate, OffsetDateTime, Temporal, TemporalField, TemporalQueries, TemporalQuery, TemporalUnit, ZoneId, ZoneOffset } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * The number of seconds per day.\n */\nconst SECONDS_PER_DAY = 86400;\n\n/**\n * A date with an offset from UTC/Greenwich in the ISO-8601 calendar system,\n * such as `2007-12-03+01:00`.\n * \n * `OffsetDate` is an immutable date-time object that represents a date, often viewed\n * as year-month-day-offset. This object can also access other date fields such as\n * day-of-year, day-of-week and week-of-year.\n * \n * This class does not store or represent a time.\n * For example, the value '2nd October 2007 +02:00' can be stored\n * in an `OffsetDate`.\n *\n */\nexport class OffsetDate extends Temporal {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link OffsetDate.now}\n * - if called with 0 argument {@link OffsetDate._now0} is executed,\n * - if called with 1 argument and first argument is an instance of ZoneId, then {@link OffsetDate._nowZoneId} is executed,\n * - otherwise {@link OffsetDate._nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {YearQuarter}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return OffsetDate._now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return OffsetDate._nowZoneId(zoneIdOrClock);\n } else {\n return OffsetDate._nowClock(zoneIdOrClock);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current date from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current date.\n * The offset will be calculated from the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {OffsetDate} the current date using the system clock, not null\n * @protected\n */\n static _now0() {\n return OffsetDate.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current date from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current date.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * The offset will be calculated from the specified time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {OffsetDate} the current date using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return OffsetDate.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current date from the specified clock.\n * \n * This will query the specified clock to obtain the current date - today.\n * The offset will be calculated from the time-zone in the clock.\n * \n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {OffsetDate} the current date, not null\n * @protected\n */\n static _nowClock(clock) {\n requireNonNull(clock, 'clock');\n const now = clock.instant(); // called once\n return OffsetDate.ofInstant(now, clock.zone().rules().offset(now));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link OffsetDate.of}\n * - if called with 2 arguments {@link OffsetDate._ofLocalDateZoneOffset} is executed,\n * - if called with 4 agruments {@link OffsetDate._ofIntIntIntZoneOffset} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @return {YearQuarter}\n */\n static of() {\n switch (arguments.length) {\n case 2: return OffsetDate._ofLocalDateZoneOffset(...arguments);\n case 4: return OffsetDate._ofIntIntIntZoneOffset(...arguments);\n default: throw new IllegalArgumentException('Illegal number of arguments');\n }\n }\n\n /**\n * Obtains an instance of `OffsetDate` from a local date and an offset.\n *\n * @param {LocalDate} date - the local date, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @return {OffsetDate} the offset date, not null\n * @protected\n */\n static _ofLocalDateZoneOffset(date, offset) {\n return new OffsetDate(date, offset);\n }\n\n /**\n * Obtains an instance of `OffsetDate` from a year, month, day\n * and offset.\n * \n * This creates an offset date with the four specified fields.\n * \n * This method exists primarily for writing test cases.\n * Non test-code will typically use other methods to create an offset time.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} month - the month-of-year to represent, from 1 (January) to 12 (December)\n * @param {number} dayOfMonth - the day-of-month to represent, from 1 to 31\n * @param {ZoneOffset} offset - the zone offset, not null\n * @return {OffsetDate} the offset date, not null\n * @throws {DateTimeException} if the value of any field is out of range, or\n * if the day-of-month is invalid for the month-year\n * @protected\n */\n static _ofIntIntIntZoneOffset(year, month, dayOfMonth, offset) {\n const d = LocalDate.of(year, month, dayOfMonth);\n return new OffsetDate(d, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `OffsetDate` from an `Instant` and zone ID.\n * \n * This creates an offset date with the same instant as midnight at the\n * start of day of the instant specified.\n * Finding the offset from UTC/Greenwich is simple as there is only one valid\n * offset for each instant.\n *\n * @param {Instant} instant - the instant to create the time from, not null\n * @param {ZoneId} zone - the time-zone, which may be an offset, not null\n * @return {OffsetDate} the offset time, not null\n */\n static ofInstant(instant, zone) {\n requireNonNull(instant, 'instant');\n requireNonNull(zone, 'zone');\n const rules = zone.rules();\n const offset = rules.offset(instant);\n const epochSec = instant.epochSecond() + offset.totalSeconds(); // overflow caught later\n const epochDay = MathUtil.floorDiv(epochSec, SECONDS_PER_DAY);\n const date = LocalDate.ofEpochDay(epochDay);\n return new OffsetDate(date, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `OffsetDate` from a temporal object.\n * \n * A `TemporalAccessor` represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of `OffsetDate`.\n * \n * The conversion extracts and combines `LocalDate` and `ZoneOffset`.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, `OffsetDate.FROM`.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {OffsetDate} the offset date, not null\n * @throws {DateTimeException} if unable to convert to an `OffsetDate`\n */\n static from(temporal) {\n if (temporal instanceof OffsetDate) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n const date = LocalDate.from(temporal);\n const offset = ZoneOffset.from(temporal);\n return new OffsetDate(date, offset);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain OffsetDate from TemporalAccessor: ${temporal.constructor.name}`, ex);\n }\n }\n\n /**\n * Obtains an instance of `OffsetDate` from a text string using a specific formatter.\n * \n * The text is parsed using the formatter, returning a date.\n *\n * @param {CharSequence} text - the text to parse, not null\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {OffsetDate} the parsed offset date, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_OFFSET_DATE) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, OffsetDate.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDate} date - the local date, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @private\n */\n constructor(date, offset) {\n super();\n this._date = requireNonNull(date, 'date');\n this._offset = requireNonNull(offset, 'offset');\n }\n\n /**\n * Returns a new date based on this one, returning `this` where possible.\n *\n * @param {LocalDate} date - the date to create with, not null\n * @param {ZoneOffset} offset - the zone offset to create with, not null\n * @private\n */\n _with(date, offset) {\n if (this._date === date && this._offset.equals(offset)) {\n return this;\n }\n return new OffsetDate(date, offset);\n }\n\n /**\n * function overloading for {@link OffsetDate.isSupported}\n * - if called with an instance of {@link TemporalField}, then {@link OffsetDate._isSupportedField} is executed,\n * - if called with an instance of {@link TemporalUnit}, then {@link OffsetDate._isSupportedUnit} is executed,\n * - otherwise {@link IllegalArgumentException} is thrown.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit\n * @return {boolean}\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof TemporalField) {\n return this._isSupportedField(fieldOrUnit);\n }\n if (fieldOrUnit instanceof TemporalUnit) {\n return this._isSupportedUnit(fieldOrUnit);\n }\n if (fieldOrUnit == null) {\n return false;\n }\n throw new IllegalArgumentException(`fieldOrUnit must be an instance of TemporalField or TemporalUnit, but is ${fieldOrUnit.constructor.name}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this date can be queried for the specified field.\n * If false, then calling the {@link OffsetDate.range},\n * {@link OffsetDate.get} and {@link OffsetDate.with}\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * \n * - `DAY_OF_WEEK`\n * - `ALIGNED_DAY_OF_WEEK_IN_MONTH`\n * - `ALIGNED_DAY_OF_WEEK_IN_YEAR`\n * - `DAY_OF_MONTH`\n * - `DAY_OF_YEAR`\n * - `EPOCH_DAY`\n * - `ALIGNED_WEEK_OF_MONTH`\n * - `ALIGNED_WEEK_OF_YEAR`\n * - `MONTH_OF_YEAR`\n * - `PROLEPTIC_MONTH`\n * - `YEAR_OF_ERA`\n * - `YEAR`\n * - `ERA`\n * - `OFFSET_SECONDS`\n * \n * All other `ChronoField` instances will return false.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this date, false if not\n * @protected\n */\n _isSupportedField(field) {\n if (field instanceof ChronoField) {\n return field.isDateBased() || field === ChronoField.OFFSET_SECONDS;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n * \n * This checks if the specified unit can be added to, or subtracted from, this date.\n * If false, then calling the {@link OffsetDate.plus(long, TemporalUnit)} and\n * {@link OffsetDate.minus(long, TemporalUnit) minus} methods will throw an exception.\n * \n * If the unit is a {@link ChronoUnit} then the query is implemented here.\n * The supported units are:\n * <ul>\n * - `DAYS`\n * - `WEEKS`\n * - `MONTHS`\n * - `YEARS`\n * - `DECADES`\n * - `CENTURIES`\n * - `MILLENNIA`\n * - `ERAS`\n * </ul>\n * All other `ChronoUnit` instances will return false.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.isSupportedBy(Temporal)`\n * passing `this` as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if the unit can be added/subtracted, false if not\n * @protected\n */\n _isSupportedUnit(unit) {\n if (unit instanceof ChronoUnit) {\n return unit.isDateBased();\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This date is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OffsetDate.isSupported} supported fields will return\n * appropriate range instances.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return field.range();\n }\n return this._date.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this date as an `int`.\n * \n * This queries this date for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OffsetDate.isSupported} supported fields will return valid\n * values based on this date, except `EPOCH_DAY` and `PROLEPTIC_MONTH`\n * which are too large to fit in an `int` and throw a `DateTimeException`.\n * All other `ChronoField` instances will throw a `DateTimeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this date as a `long`.\n * \n * This queries this date for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OffsetDate.isSupported} supported fields will return valid\n * values based on this date.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return this.offset().totalSeconds();\n }\n return this._date.getLong(field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the zone offset, such as '+01:00'.\n * \n * This is the offset of the local date from UTC/Greenwich.\n *\n * @return {ZoneOffset} the zone offset, not null\n */\n offset() {\n return this._offset;\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified offset ensuring\n * that the result has the same local date.\n * \n * This method returns an object with the same `LocalDate` and the specified `ZoneOffset`.\n * No calculation is needed or performed.\n * For example, if this time represents `2007-12-03+02:00` and the offset specified is\n * `+03:00`, then this method will return `2007-12-03+03:00`.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {ZoneOffset} offset - the zone offset to change to, not null\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested offset, not null\n */\n withOffsetSameLocal(offset) {\n requireNonNull(offset, 'offset');\n return this._with(this._date, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the `LocalDate` part of this date.\n * \n * This returns a `LocalDate` with the same year, month and day\n * as this date.\n *\n * @return {LocalDate} the date part of this date, not null\n */\n toLocalDate() {\n return this._date;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n * \n * This method returns the primitive `int` value for the year.\n * \n * The year returned by this method is proleptic as per `get(YEAR)`.\n * To obtain the year-of-era, use `get(YEAR_OF_ERA)`.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._date.year();\n }\n\n /**\n * Gets the month-of-year field from 1 to 12.\n * \n * This method returns the month as an `int` from 1 to 12.\n * Application code is frequently clearer if the enum {@link Month}\n * is used by calling {@link OffsetDate.month}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see OffsetDate.month()\n */\n monthValue() {\n return this._date.monthValue();\n }\n\n /**\n * Gets the month-of-year field using the `Month` enum.\n * \n * This method returns the enum {@link Month} for the month.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link Month.value} int value.\n *\n * @return {Month} the month-of-year, not null\n * @see OffsetDate.monthValue()\n */\n month() {\n return this._date.month();\n }\n\n /**\n * Gets the day-of-month field.\n * \n * This method returns the primitive `int` value for the day-of-month.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n dayOfMonth() {\n return this._date.dayOfMonth();\n }\n\n /**\n * Gets the day-of-year field.\n * \n * This method returns the primitive `int` value for the day-of-year.\n *\n * @return {number} the day-of-year, from 1 to 365, or 366 in a leap year\n */\n dayOfYear() {\n return this._date.dayOfYear();\n }\n\n /**\n * Gets the day-of-week field, which is an enum `DayOfWeek`.\n * \n * This method returns the enum {@link DayOfWeek} for the day-of-week.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link DayOfWeek.value} int value.\n * \n * Additional information can be obtained from the `DayOfWeek`.\n * This includes textual names of the values.\n *\n * @return {DayOfWeek} the day-of-week, not null\n */\n dayOfWeek() {\n return this._date.dayOfWeek();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this date.\n * \n * This returns an `OffsetDate` based on this one, with the date adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n * \n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the date to the last day of the month.\n * A selection of common adjustments is provided in {@link TemporalAdjusters}.\n * These include finding the 'last day of the month' and 'next Wednesday'.\n * Key date-time classes also implement the `TemporalAdjuster` interface,\n * such as {@link Month} and {@link MonthDay}.\n * The adjuster is responsible for handling special cases, such as the varying\n * lengths of month and leap years.\n * \n * For example this code returns a date on the last day of July:\n * <pre>\n * import static java.time.Month.*;\n * import static java.time.temporal.TemporalAdjusters.*;\n *\n * result = offsetDate.with(JULY).with(lastDayOfMonth());\n * </pre>\n * \n * The classes {@link LocalDate} and {@link ZoneOffset} implement `TemporalAdjuster`,\n * thus this method can be used to change the date or offset:\n * <pre>\n * result = offsetDate.with(date);\n * result = offsetDate.with(offset);\n * </pre>\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster.adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {OffsetDate} an `OffsetDate` based on `this` with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof LocalDate) {\n return this._with(adjuster, this._offset);\n } else if (adjuster instanceof ZoneOffset) {\n return this._with(this._date, adjuster);\n } else if (adjuster instanceof OffsetDate) {\n return adjuster;\n }\n return super._withAdjuster(adjuster);\n }\n\n /**\n * Returns a copy of this date with the specified field set to a new value.\n * \n * This returns an `OffsetDate` based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year, month or day-of-month.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n * \n * In some cases, changing the specified field can cause the resulting date to become invalid,\n * such as changing the month from 31st January to February would make the day-of-month invalid.\n * In cases like this, the field is responsible for resolving the date. Typically it will choose\n * the previous valid date, which would be the last valid day of February in this example.\n * \n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * \n * The `OFFSET_SECONDS` field will return a date with the specified offset.\n * The local date is unaltered. If the new offset value is outside the valid range\n * then a `DateTimeException` will be thrown.\n * \n * The other {@link OffsetDate.isSupported} supported fields will behave as per\n * the matching method on {@link LocalDate.with} LocalDate.\n * In this case, the offset is not part of the calculation and will be unchanged.\n * \n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.adjustInto(Temporal, long)`\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {OffsetDate} an `OffsetDate` based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withField(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n const f = field;\n return this._with(this._date, ZoneOffset.ofTotalSeconds(f.checkValidIntValue(newValue)));\n }\n return this._with(this._date.with(field, newValue), this._offset);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `OffsetDate` with the year altered.\n * \n * The offset does not affect the calculation and will be the same in the result.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {OffsetDate} year - the year to set in the result, from MIN_YEAR to MAX_YEAR\n * @return {number} an `OffsetDate` based on this date with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n return this._with(this._date.withYear(year), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the month-of-year altered.\n * \n * The offset does not affect the calculation and will be the same in the result.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested month, not null\n * @throws {DateTimeException} if the month-of-year value is invalid\n */\n withMonth(month) {\n return this._with(this._date.withMonth(month), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the day-of-month altered.\n * \n * If the resulting date is invalid, an exception is thrown.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfMonth - the day-of-month to set in the result, from 1 to 28-31\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-month value is invalid,\n * or if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n return this._with(this._date.withDayOfMonth(dayOfMonth), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the day-of-year altered.\n * \n * If the resulting date is invalid, an exception is thrown.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfYear - the day-of-year to set in the result, from 1 to 365-366\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-year value is invalid,\n * or if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n return this._with(this._date.withDayOfYear(dayOfYear), this._offset);\n }\n\n /**\n * Returns a copy of this date with the specified amount added.\n * \n * This returns an `OffsetDate` based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoUnit} then the addition is implemented by\n * {@link LocalDate.plus}.\n * The offset is not part of the calculation and will be unchanged in the result.\n * \n * If the field is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.addTo(Temporal, long)`\n * passing `this` as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to add, not null\n * @return {OffsetDate} an `OffsetDate` based on this date with the specified amount added, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _plusUnit(amountToAdd, unit) {\n if (unit instanceof ChronoUnit) {\n return this._with(this._date.plus(amountToAdd, unit), this._offset);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `OffsetDate` with the specified number of years added.\n * \n * This uses {@link LocalDate.plusYears} to add the years.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusYears(years) {\n return this._with(this._date.plusYears(years), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of months added.\n * \n * This uses {@link LocalDate.plusMonths} to add the months.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the months added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMonths(months) {\n return this._with(this._date.plusMonths(months), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of weeks added.\n * \n * This uses {@link LocalDate.plusWeeks} to add the weeks.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the weeks added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusWeeks(weeks) {\n return this._with(this._date.plusWeeks(weeks), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of days added.\n * \n * This uses {@link LocalDate.plusDays)} to add the days.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the days added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusDays(days) {\n return this._with(this._date.plusDays(days), this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `OffsetDate` with the specified number of years subtracted.\n * \n * This uses {@link LocalDate.minusYears} to subtract the years.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusYears(years) {\n return this._with(this._date.minusYears(years), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of months subtracted.\n * \n * This uses {@link LocalDate.minusMonths} to subtract the months.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the months subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMonths(months) {\n return this._with(this._date.minusMonths(months), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of weeks subtracted.\n * \n * This uses {@link LocalDate.minusWeeks} to subtract the weeks.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the weeks subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusWeeks(weeks) {\n return this._with(this._date.minusWeeks(weeks), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of days subtracted.\n * \n * This uses {@link LocalDate.minusDays} to subtract the days.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the days subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusDays(days) {\n return this._with(this._date.minusDays(days), this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this date using the specified query.\n * \n * This queries this date using the specified query strategy object.\n * The `TemporalQuery` object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.DAYS;\n } else if (query === TemporalQueries.offset() || query === TemporalQueries.zone()) {\n return this.offset();\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have the same offset and date\n * as this object.\n * \n * This returns a temporal object of the same observable type as the input\n * with the offset and date changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * twice, passing {@link ChronoField.OFFSET_SECONDS} and\n * {@link ChronoField.EPOCH_DAY} as the fields.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with(TemporalAdjuster)}:\n * <pre>\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisOffsetDate.adjustInto(temporal);\n * temporal = temporal.with(thisOffsetDate);\n * </pre>\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal\n .with(ChronoField.OFFSET_SECONDS, this.offset().totalSeconds())\n .with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay());\n }\n\n /**\n * Calculates the period between this date and another date in\n * terms of the specified unit.\n * \n * This calculates the period between two dates in terms of a single unit.\n * The start and end points are `this` and the specified date.\n * The result will be negative if the end is before the start.\n * For example, the period in days between two dates can be calculated\n * using `startDate.until(endDate, DAYS)`.\n * \n * The `Temporal` passed to this method is converted to a\n * `OffsetDate` using {@link OffsetDate.from}.\n * If the offset differs between the two times, then the specified\n * end time is normalized to have the same offset as this time.\n * \n * The calculation returns a whole number, representing the number of\n * complete units between the two dates.\n * For example, the period in months between 2012-06-15Z and 2012-08-14Z\n * will only be one month as it is one day short of two months.\n * \n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit.between}:\n * <pre>\n * // these two lines are equivalent\n * amount = start.until(end, DAYS);\n * amount = DAYS.between(start, end);\n * </pre>\n * The choice should be made based on which makes the code more readable.\n * \n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units `DAYS`, `WEEKS`, `MONTHS`, `YEARS`,\n * `DECADES`, `CENTURIES`, `MILLENNIA` and `ERAS`\n * are supported. Other `ChronoUnit` values will throw an exception.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.between(Temporal, Temporal)`\n * passing `this` as the first argument and the converted input temporal\n * as the second argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end time, exclusive, which is converted to an `OffsetDate`, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this date and the end date\n * @throws {DateTimeException} if the amount cannot be calculated, or the end\n * temporal cannot be converted to an `OffsetDate`\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n const end = OffsetDate.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const offsetDiff = end._offset.totalSeconds() - this._offset.totalSeconds();\n const endLocal = end._date.plusDays(MathUtil.intDiv(-offsetDiff, SECONDS_PER_DAY));\n return this._date.until(endLocal, unit);\n }\n return unit.between(this, end);\n }\n\n /**\n * Formats this date using the specified formatter.\n * \n * This date will be passed to the formatter to produce a string.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted date string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an offset date-time formed from this date at the specified time.\n * \n * This combines this date with the specified time to form an `OffsetDateTime`.\n * All possible combinations of date and time are valid.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {LocalTime} time - the time to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this date and the specified time, not null\n */\n atTime(time) {\n return OffsetDateTime.of(this._date, time, this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Converts this date to midnight at the start of day in epoch seconds.\n *\n * @return {number} the epoch seconds value\n * @private\n */\n _toEpochSecond() {\n const epochDay = this._date.toEpochDay();\n const secs = epochDay * SECONDS_PER_DAY;\n return secs - this._offset.totalSeconds();\n }\n\n /**\n * Converts this `OffsetDate` to the number of seconds since the epoch\n * of 1970-01-01T00:00:00Z.\n * \n * This combines this offset date with the specified time\n * to calculate the epoch-second value, which is the\n * number of elapsed seconds from 1970-01-01T00:00:00Z.\n * Instants on the time-line after the epoch are positive, earlier\n * are negative.\n *\n * @param {LocalTime} time - the local time, not null\n * @return {number} the number of seconds since the epoch of 1970-01-01T00:00:00Z, may be negative\n */\n toEpochSecond(time) {\n requireNonNull(time, 'time');\n return this._toEpochSecond() + time.toSecondOfDay();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this `OffsetDate` to another date.\n * \n * The comparison is based first on the UTC equivalent instant, then on the local date.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n * \n * For example, the following is the comparator order:\n * 1. 2008-06-29-11:00</li>\n * 2. 2008-06-29-12:00</li>\n * 3. 2008-06-30+12:00</li>\n * 4. 2008-06-29-13:00</li>\n * \n * Values #2 and #3 represent the same instant on the time-line.\n * When two values represent the same instant, the local date is compared\n * to distinguish them. This step is needed to make the ordering\n * consistent with `equals()`.\n * \n * To compare the underlying local date of two `TemporalAccessor` instances,\n * use {@link ChronoField.EPOCH_DAY} as a comparator.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n if (this._offset.equals(other._offset)) {\n return this._date.compareTo(other._date);\n }\n let compare = this._toEpochSecond() - other._toEpochSecond();\n if (compare === 0) {\n compare = this._date.compareTo(other._date);\n }\n return compare;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the instant of midnight at the start of this `OffsetDate`\n * is after midnight at the start of the specified date.\n * \n * This method differs from the comparison in {@link OffsetDate.compareTo} in that it\n * only compares the instant of the date. This is equivalent to using\n * `date1.toEpochSecond().isAfter(date2.toEpochSecond())`.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {boolean} true if this is after the instant of the specified date\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n return this._toEpochSecond() > other._toEpochSecond();\n }\n\n /**\n * Checks if the instant of midnight at the start of this `OffsetDate`\n * is before midnight at the start of the specified date.\n * \n * This method differs from the comparison in {@link OffsetDate.compareTo} in that it\n * only compares the instant of the date. This is equivalent to using\n * `date1.toEpochSecond().isBefore(date2.toEpochSecond())`.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {boolean} true if this is before the instant of the specified date\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n return this._toEpochSecond() < other._toEpochSecond();\n }\n\n /**\n * Checks if the instant of midnight at the start of this `OffsetDate`\n * equals midnight at the start of the specified date.\n * \n * This method differs from the comparison in {@link OffsetDate.compareTo} and {@link OffsetDate.equals}\n * in that it only compares the instant of the date. This is equivalent to using\n * `date1.toEpochSecond().equals(date2.toEpochSecond())`.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {boolean} true if the instant equals the instant of the specified date\n */\n isEqual(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n return this._toEpochSecond() === other._toEpochSecond();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date is equal to another date.\n * \n * The comparison is based on the local-date and the offset.\n * To compare for the same instant on the time-line, use {@link OffsetDate.isEqual}.\n * \n * Only objects of type `OffsetDate` are compared, other types return false.\n * To compare the underlying local date of two `TemporalAccessor` instances,\n * use {@link ChronoField.EPOCH_DAY} as a comparator.\n *\n * @param {Object} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other date\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof OffsetDate) {\n const other = obj;\n return this._date.equals(other._date) && this._offset.equals(other._offset);\n }\n return false;\n }\n\n /**\n * A hash code for this date.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._date.hashCode() ^ this._offset.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this date as a `String`, such as `2007-12-03+01:00`.\n * \n * The output will be in the ISO-8601 format `yyyy-MM-ddXXXXX`.\n *\n * @return {String} a string representation of this date, not null\n */\n toString() {\n return this._date.toString() + this._offset.toString();\n }\n}\n\nexport function _init() {\n /**\n * The minimum supported `OffsetDate`, '-999999999-01-01+18:00'.\n * This is the minimum local date in the maximum offset\n * (larger offsets are earlier on the time-line).\n * This combines {@link LocalDate.MIN} and {@link ZoneOffset.MAX}.\n * This could be used by an application as a 'far past' date.\n */\n OffsetDate.MIN = OffsetDate.of(LocalDate.MIN, ZoneOffset.MAX);\n /**\n * The maximum supported `OffsetDate`, '+999999999-12-31-18:00'.\n * This is the maximum local date in the minimum offset\n * (larger negative offsets are later on the time-line).\n * This combines {@link LocalDate.MAX} and {@link ZoneOffset.MIN}.\n * This could be used by an application as a 'far future' date.\n */\n OffsetDate.MAX = OffsetDate.of(LocalDate.MAX, ZoneOffset.MIN);\n\n OffsetDate.FROM = createTemporalQuery('OffsetDate.FROM', (temporal) => {\n return OffsetDate.from(temporal);\n });\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\nimport { ChronoField, DateTimeException, IllegalArgumentException, IllegalStateException, IsoChronology, IsoFields, Month, TemporalAccessor, TemporalField, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A quarter-of-year, such as 'Q2'.\n * \n * `Quarter` is an enum representing the 4 quarters of the year -\n * Q1, Q2, Q3 and Q4. These are defined as January to March, April to June,\n * July to September and October to December.\n * \n * The `int` value follows the quarter, from 1 (Q1) to 4 (Q4).\n * It is recommended that applications use the enum rather than the `int` value\n * to ensure code clarity.\n * \n * **Do not use `ordinal()` to obtain the numeric representation of `Quarter`.\n * Use `getValue()` instead.**\n * \n * This enum represents a common concept that is found in many calendar systems.\n * As such, this enum may be used by any calendar system that has the quarter-of-year\n * concept defined exactly equivalent to the ISO calendar system.\n *\n */\nexport class Quarter extends TemporalAccessor {\n /**\n * replacement for enum `valueOf(name)`\n * \n * @param {string} name\n * @return {Quarter}\n */\n static valueOf(name) {\n requireNonNull(name, 'name');\n switch (name) {\n case 'Q1':\n return Quarter.Q1;\n case 'Q2':\n return Quarter.Q2;\n case 'Q3':\n return Quarter.Q3;\n case 'Q4':\n return Quarter.Q4;\n }\n throw new IllegalArgumentException(`No enum constant Quarter.${name}`);\n }\n\n /**\n * replacement for enum `values()`\n * @return {Quarter[]}\n */\n static values() {\n return QUARTERS.slice();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `Quarter` from an `int` value.\n * \n * `Quarter` is an enum representing the 4 quarters of the year.\n * This factory allows the enum to be obtained from the `int` value.\n * The `int` value follows the quarter, from 1 (Q1) to 4 (Q4).\n *\n * @param {number} quarterOfYear - the quarter-of-year to represent, from 1 (Q1) to 4 (Q4)\n * @return {Quarter} the quarter-of-year, not null\n * @throws {DateTimeException} if the quarter-of-year is invalid\n */\n static of(quarterOfYear) {\n requireNonNull(quarterOfYear, 'quarterOfYear');\n switch (quarterOfYear) {\n case 1:\n return Quarter.Q1;\n case 2:\n return Quarter.Q2;\n case 3:\n return Quarter.Q3;\n case 4:\n return Quarter.Q4;\n default:\n throw new DateTimeException(`Invalid value for Quarter: ${quarterOfYear}`);\n }\n }\n\n /**\n * Obtains an instance of `Quarter` from a month-of-year.\n * \n * `Quarter` is an enum representing the 4 quarters of the year.\n * This factory allows the enum to be obtained from the `Month` value.\n * \n * January to March are Q1, April to June are Q2, July to September are Q3\n * and October to December are Q4.\n *\n * @param {number} monthOfYear - the month-of-year to convert from, from 1 to 12\n * @return {Quarter} the quarter-of-year, not null\n * @throws {DateTimeException} if the month-of-year is invalid\n */\n static ofMonth(monthOfYear) {\n requireNonNull(monthOfYear, 'monthOfYear');\n ChronoField.MONTH_OF_YEAR.range().checkValidValue(monthOfYear, ChronoField.MONTH_OF_YEAR);\n return Quarter.of(MathUtil.intDiv(monthOfYear - 1, 3) + 1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `Quarter` from a temporal object.\n * \n * This obtains a quarter based on the specified temporal.\n * A `TemporalAccessor` represents an arbitrary set of date and time information,\n * which this factory converts to an instance of `Quarter`.\n * \n * The conversion extracts the {@link IsoFields.QUARTER_OF_YEAR} field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a `LocalDate`.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, `Quarter.from`.\n *\n * @param {Temporal} temporal - the temporal-time object to convert, not null\n * @return {Quarter} the quarter-of-year, not null\n * @throws {DateTimeException} if unable to convert to a `Quarter`\n */\n static from(temporal) {\n if (temporal instanceof Quarter) {\n return temporal;\n } else if (temporal instanceof Month) {\n const month = temporal;\n return Quarter.of(MathUtil.intDiv(month.ordinal(), 3) + 1);\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }\n */\n const qoy = MathUtil.safeToInt(temporal.getLong(IsoFields.QUARTER_OF_YEAR));\n return Quarter.of(qoy);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain Quarter from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n /**\n * \n * @param {number} value\n * @param {string} name\n * @private\n */\n constructor(value, name) {\n super();\n this._value = MathUtil.safeToInt(value);\n this._name = name;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the quarter-of-year `int` value.\n * \n * The values are numbered following the ISO-8601 standard,\n * from 1 (Q1) to 4 (Q4).\n *\n * @return {number} the quarter-of-year, from 1 (Q1) to 4 (Q4)\n */\n value() {\n return this._value;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the textual representation, such as 'Q1' or '4th quarter'.\n * \n * This returns the textual name used to identify the quarter-of-year,\n * suitable for presentation to the user.\n * The parameters control the style of the returned text and the locale.\n * \n * If no textual mapping is found then the {@link #getValue() numeric value} is returned.\n *\n * @param {TextStyle} style - the length of the text required, not null\n * @param {Locale} locale - the locale to use, not null\n * @return {string} the text value of the day-of-week, not null\n */\n // eslint-disable-next-line no-unused-vars\n displayName(style, locale) {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented yet!');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this quarter-of-year can be queried for the specified field.\n * If false, then calling the {@link #range(TemporalField) range} and\n * {@link #get(TemporalField) get} methods will throw an exception.\n * \n * If the field is {@link IsoFields#QUARTER_OF_YEAR QUARTER_OF_YEAR} then\n * this method returns true.\n * All `ChronoField` instances will return false.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this quarter-of-year, false if not\n */\n isSupported(field) {\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return true;\n } else if (field instanceof ChronoField) {\n return false;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This quarter is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is {@link IsoFields#QUARTER_OF_YEAR QUARTER_OF_YEAR} then the\n * range of the quarter-of-year, from 1 to 4, will be returned.\n * All `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return field.range();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this quarter-of-year as an `int`.\n * \n * This queries this quarter for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is {@link IsoFields.QUARTER_OF_YEAR} then the\n * value of the quarter-of-year, from 1 to 4, will be returned.\n * All `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field, within the valid range of values\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this quarter-of-year as a `long`.\n * \n * This queries this quarter for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is {@link IsoFields#QUARTER_OF_YEAR QUARTER_OF_YEAR} then the\n * value of the quarter-of-year, from 1 to 4, will be returned.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return this.value();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the quarter that is the specified number of quarters after this one.\n * \n * The calculation rolls around the end of the year from Q4 to Q1.\n * The specified period may be negative.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quarters - the quarters to add, positive or negative\n * @return {Quarter} the resulting quarter, not null\n */\n plus(quarters) {\n const amount = MathUtil.intMod(quarters, 4);\n return QUARTERS[(this.ordinal() + amount + 4) % 4];\n }\n\n /**\n * Returns the quarter that is the specified number of quarters before this one.\n * \n * The calculation rolls around the start of the year from Q1 to Q4.\n * The specified period may be negative.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quarters - the quarters to subtract, positive or negative\n * @return {Quarter} the resulting quarter, not null\n */\n minus(quarters) {\n return this.plus(-(MathUtil.intMod(quarters, 4)));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the length of this quarter in days.\n * \n * This takes a flag to determine whether to return the length for a leap year or not.\n * \n * Q1 has 90 in a standard year and 91 days in a leap year.\n * Q2 has 91 days.\n * Q3 and Q4 have 92 days.\n *\n * @param {boolean} leapYear - true if the length is required for a leap year\n * @return {number} the length of this month in days, from 90 to 92\n */\n length(leapYear) {\n switch (this) {\n case Quarter.Q1:\n return (leapYear ? 91 : 90);\n case Quarter.Q2:\n return 91;\n default:\n return 92;\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the first of the three months that this quarter refers to.\n * \n * Q1 will return January.\n * Q2 will return April.\n * Q3 will return July.\n * Q4 will return October.\n * \n * To obtain the other two months of the quarter, simply use {@link Month#plus(long)}\n * on the returned month.\n *\n * @return {Month} the first month in the quarter, not null\n */\n firstMonth() {\n switch (this) {\n case Quarter.Q1:\n return Month.JANUARY;\n case Quarter.Q2:\n return Month.APRIL;\n case Quarter.Q3:\n return Month.JULY;\n case Quarter.Q4:\n return Month.OCTOBER;\n default:\n throw new IllegalStateException('Unreachable');\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this quarter-of-year using the specified query.\n * \n * This queries this quarter-of-year using the specified query strategy object.\n * The `TemporalQuery` object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom(TemporalAccessor)} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return IsoFields.QUARTER_YEARS;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this quarter-of-year.\n * \n * This returns a temporal object of the same observable type as the input\n * with the quarter-of-year changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link IsoFields.QUARTER_OF_YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a `DateTimeException` is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisQuarter.adjustInto(temporal);\n * temporal = temporal.with(thisQuarter);\n * ```\n * \n * For example, given a date in May, the following are output:\n * ```\n * dateInMay.with(Q1); // three months earlier\n * dateInMay.with(Q2); // no change\n * dateInMay.with(Q3); // three months later\n * dateInMay.with(Q4); // six months later\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }\n */\n return temporal.with(IsoFields.QUARTER_OF_YEAR, this.value());\n }\n\n //-----------------------------------------------------------------------\n // Enum\n //-----------------------------------------------------------------------\n\n /**\n *\n * @return {number}\n */\n ordinal() {\n return this._value - 1;\n }\n\n /**\n *\n * @return {string}\n */\n name() {\n return this._name;\n }\n\n //-----------------------------------------------------------------------\n // Comparable\n //-----------------------------------------------------------------------\n\n /**\n * Compares this Quarter to another Quarter.\n *\n * The comparison is based on the value of the Quarter.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Quarter} other - the other quarter to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Quarter, 'other');\n return this._value - other._value;\n }\n\n //-----------------------------------------------------------------------\n // Object\n //-----------------------------------------------------------------------\n\n /**\n * Outputs this quarter as a String, such as Q1\n *\n * @return {string} a string representation of this quarter, not null\n */\n toString() {\n return this.name();\n }\n\n /**\n *\n * @return {boolean}\n */\n equals(other){\n return this === other;\n }\n\n /**\n * A hash code for this quarter.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._value;\n }\n}\n\nlet QUARTERS;\n\nexport function _init() {\n /**\n * The singleton instance for the first quarter-of-year, from January to March.\n * This has the numeric value of `1`.\n */\n Quarter.Q1 = new Quarter(1, 'Q1');\n /**\n * The singleton instance for the second quarter-of-year, from April to June.\n * This has the numeric value of `2`.\n */\n Quarter.Q2 = new Quarter(2, 'Q2');\n /**\n * The singleton instance for the third quarter-of-year, from July to September.\n * This has the numeric value of `3`.\n */\n Quarter.Q3 = new Quarter(3, 'Q3');\n /**\n * The singleton instance for the fourth quarter-of-year, from October to December.\n * This has the numeric value of `4`.\n */\n Quarter.Q4 = new Quarter(4, 'Q4');\n\n Quarter.FROM = createTemporalQuery('Quarter.FROM', (temporal) => {\n return Quarter.from(temporal);\n });\n\n QUARTERS = [\n Quarter.Q1,\n Quarter.Q2,\n Quarter.Q3,\n Quarter.Q4\n ];\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/**\n * @copyright (c) 2015-present, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { requireNonNull } from './assert';\nimport { ChronoField, ChronoUnit, DateTimeException, DateTimeParseException, IsoFields, ParsePosition, TemporalAdjuster, UnsupportedTemporalTypeException } from '@js-joda/core';\n\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * Additional utilities for working with temporal classes.\n * \n * This includes:\n * - adjusters that ignore Saturday/Sunday weekends\n * - conversion between `TimeUnit` and `ChronoUnit`\n * - converting an amount to another unit\n *\n */\nexport class Temporals {\n //-------------------------------------------------------------------------\n /**\n * Returns an adjuster that returns the next working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n *\n * @return {TemporalAdjuster} the next working day adjuster, not null\n */\n static nextWorkingDay() {\n return Adjuster.NEXT_WORKING;\n }\n\n /**\n * Returns an adjuster that returns the next working day or same day if already working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n * \n * @return {TemporalAdjuster} the next working day or same adjuster, not null\n */\n static nextWorkingDayOrSame() {\n return Adjuster.NEXT_WORKING_OR_SAME;\n }\n\n /**\n * Returns an adjuster that returns the previous working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n *\n * @return {TemporalAdjuster} the previous working day adjuster, not null\n */\n static previousWorkingDay() {\n return Adjuster.PREVIOUS_WORKING;\n }\n\n /**\n * Returns an adjuster that returns the previous working day or same day if already working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n * \n * @return {TemporalAdjuster} the previous working day or same adjuster, not null\n */\n static previousWorkingDayOrSame() {\n return Adjuster.PREVIOUS_WORKING_OR_SAME;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Parses the text using one of the formatters.\n * \n * This will try each formatter in turn, attempting to fully parse the specified text.\n * The temporal query is typically a method reference to a `from(TemporalAccessor)` method.\n * For example:\n * ```\n * LocalDateTime dt = Temporals.parseFirstMatching(str, LocalDateTime.FROM, fm1, fm2, fm3);\n * ```\n * If the parse completes without reading the entire length of the text,\n * or a problem occurs during parsing or merging, then an exception is thrown.\n *\n * @param {string} text the text to parse, not null\n * @param {TemporalQuery} query the query defining the type to parse to, not null\n * @param {DateTimeFormatter[]} formatters the formatters to try, not null\n * @return {*} the parsed date-time, not null\n * @throws {DateTimeParseException} if unable to parse the requested result\n */\n static parseFirstMatching(text, query, ...formatters) {\n requireNonNull(text, 'text');\n requireNonNull(query, 'query');\n requireNonNull(formatters, 'formatters');\n if (formatters.length === 0) {\n throw new DateTimeParseException('No formatters specified', text, 0);\n }\n if (formatters.length === 1) {\n return formatters[0].parse(text, query);\n }\n for (const formatter of formatters) {\n try {\n const pp = new ParsePosition(0);\n formatter.parseUnresolved(text, pp);\n const len = text.length;\n if (pp.getErrorIndex() === -1 && pp.getIndex() === len) {\n return formatter.parse(text, query);\n }\n } catch (ignored) {\n // should not happen, but ignore if it does\n }\n }\n throw new DateTimeParseException(`Text '${text}' could not be parsed`, text, 0);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Converts an amount from one unit to another.\n * \n * This works on the units in `ChronoUnit` and `IsoFields`.\n * The `DAYS` and `WEEKS` units are handled as exact multiple of 24 hours.\n * The `ERAS` and `FOREVER` units are not supported.\n *\n * @param {long} amount the input amount in terms of the `fromUnit`\n * @param {TemporalUnit} fromUnit the unit to convert from, not null\n * @param {TemporalUnit} toUnit the unit to convert to, not null\n * @return {long[]} the conversion array,\n * element 0 is the signed whole number,\n * element 1 is the signed remainder in terms of the input unit,\n * not null\n * @throws DateTimeException if the units cannot be converted\n * @throws UnsupportedTemporalTypeException if the units are not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n static convertAmount(amount, fromUnit, toUnit) {\n requireNonNull(fromUnit, 'fromUnit');\n requireNonNull(toUnit, 'toUnit');\n Temporals._validateUnit(fromUnit);\n Temporals._validateUnit(toUnit);\n if (fromUnit === toUnit) {\n return [amount, 0];\n }\n // precise-based\n if (Temporals._isPrecise(fromUnit) && Temporals._isPrecise(toUnit)) {\n const fromNanos = fromUnit.duration().toNanos();\n const toNanos = toUnit.duration().toNanos();\n if (fromNanos > toNanos) {\n const multiple = MathUtil.intDiv(fromNanos, toNanos);\n return [MathUtil.safeMultiply(amount, multiple), 0];\n } else {\n const multiple = MathUtil.intDiv(toNanos, fromNanos);\n return [MathUtil.intDiv(amount, multiple), MathUtil.intMod(amount, multiple)];\n }\n }\n // month-based\n const fromMonthFactor = Temporals._monthMonthFactor(fromUnit, fromUnit, toUnit);\n const toMonthFactor = Temporals._monthMonthFactor(toUnit, fromUnit, toUnit);\n if (fromMonthFactor > toMonthFactor) {\n const multiple = MathUtil.intDiv(fromMonthFactor, toMonthFactor);\n return [MathUtil.safeMultiply(amount, multiple), 0];\n } else {\n const multiple = MathUtil.intDiv(toMonthFactor, fromMonthFactor);\n return [MathUtil.intDiv(amount, multiple), MathUtil.intMod(amount, multiple)];\n }\n }\n\n /**\n * \n * @param {TemporalUnit} unit\n * @private\n */\n static _validateUnit(unit) {\n if (unit instanceof ChronoUnit) {\n if (unit === ChronoUnit.ERAS || unit === ChronoUnit.FOREVER) {\n throw new UnsupportedTemporalTypeException(`Unsupported TemporalUnit: ${unit}`);\n }\n } else if (unit !== IsoFields.QUARTER_YEARS) {\n throw new UnsupportedTemporalTypeException(`Unsupported TemporalUnit: ${unit}`);\n }\n }\n\n /**\n * \n * @param {TemporalUnit} unit\n * @return {boolean}\n * @private\n */\n static _isPrecise(unit) {\n return unit instanceof ChronoUnit && unit.compareTo(ChronoUnit.WEEKS) <= 0;\n }\n\n /**\n * \n * @param {TemporalUnit} unit\n * @param {TemporalUnit} fromUnit\n * @param {TemporalUnit} toUnit\n * @return {int}\n * @private\n */\n static _monthMonthFactor(unit, fromUnit, toUnit) {\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.MONTHS:\n return 1;\n case ChronoUnit.YEARS:\n return 12;\n case ChronoUnit.DECADES:\n return 120;\n case ChronoUnit.CENTURIES:\n return 1200;\n case ChronoUnit.MILLENNIA:\n return 12000;\n default:\n throw new DateTimeException(`Unable to convert between units: ${fromUnit} to ${toUnit}`);\n }\n }\n return 3; // quarters\n }\n\n /**\n * Restricted constructor.\n * \n * @private\n */\n constructor() {\n }\n}\n\nconst Adjuster = {};\n\nexport function _init() {\n /** Next working day adjuster. */\n Adjuster.NEXT_WORKING = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 6: // Saturday\n return temporal.plus(2, ChronoUnit.DAYS);\n case 5: // Friday\n return temporal.plus(3, ChronoUnit.DAYS);\n default:\n return temporal.plus(1, ChronoUnit.DAYS);\n }\n }\n };\n\n /** Previous working day adjuster. */\n Adjuster.PREVIOUS_WORKING = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 1: // Monday\n return temporal.minus(3, ChronoUnit.DAYS);\n case 7: // Sunday\n return temporal.minus(2, ChronoUnit.DAYS);\n default:\n return temporal.minus(1, ChronoUnit.DAYS);\n }\n }\n };\n\n /** Next working day or same adjuster. */\n Adjuster.NEXT_WORKING_OR_SAME = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 6: // Saturday\n return temporal.plus(2, ChronoUnit.DAYS);\n case 7: // Sunday\n return temporal.plus(1, ChronoUnit.DAYS);\n default:\n return temporal;\n }\n }\n };\n\n /** Previous working day or same adjuster. */\n Adjuster.PREVIOUS_WORKING_OR_SAME = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 6: //Saturday\n return temporal.minus(1, ChronoUnit.DAYS);\n case 7: // Sunday\n return temporal.minus(2, ChronoUnit.DAYS);\n default:\n return temporal;\n }\n }\n };\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, ChronoUnit, Clock, DateTimeException, DateTimeFormatter, DateTimeFormatterBuilder, IllegalArgumentException, IsoChronology, IsoFields, LocalDate, SignStyle, Temporal, TemporalField, TemporalQueries, TemporalQuery, TemporalUnit, UnsupportedTemporalTypeException, ValueRange, Year, ZoneId } from '@js-joda/core';\nimport { Quarter } from './Quarter';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A year-quarter in the ISO-8601 calendar system, such as `2007-Q2`.\n * \n * `YearQuarter` is an immutable date-time object that represents the combination\n * of a year and quarter. Any field that can be derived from a year and quarter can be obtained.\n * A quarter is defined by {@link Quarter} and {@link Month.firstMonthOfQuarter} - Q1, Q2, Q3 and Q4.\n * Q1 is January to March, Q2 is April to June, Q3 is July to September and Q4 is October to December.\n * \n * This class does not store or represent a day, time or time-zone.\n * For example, the value '2nd quarter 2007' can be stored in a `YearQuarter`.\n * \n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n * Note that the ISO-8601 standard does not define or refer to quarters.\n *\n */\nexport class YearQuarter extends Temporal {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearQuarter.now}\n * - if called with 0 argument {@link YearQuarter._now0} is executed,\n * - if called with 1 argument and first argument is an instance of ZoneId, then {@link YearQuarter._nowZoneId} is executed,\n * - otherwise {@link YearQuarter._nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {YearQuarter}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return YearQuarter._now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return YearQuarter._nowZoneId(zoneIdOrClock);\n } else {\n return YearQuarter._nowClock(zoneIdOrClock);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current year-quarter from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current year-quarter.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {YearQuarter} the current year-quarter using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return YearQuarter.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year-quarter from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} to obtain the current year-quarter.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {YearQuarter} the current year-quarter using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return YearQuarter.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current year-quarter from the specified clock.\n * \n * This will query the specified clock to obtain the current year-quarter.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {YearQuarter} the current year-quarter, not null\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return YearQuarter.of(now.getYear(), Quarter.from(now.getMonth()));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearQuarter.of}\n * - if called with {Year} and {Quarter} {@link YearQuarter._ofYearQuarter} is executed,\n * - if called with {Year} and {number} {@link YearQuarter._ofYearInt} is executed,\n * - if called with {number} and {Quarter} {@link YearQuarter._ofIntQuarter} is executed,\n * - if called with {number} and {number} {@link YearQuarter._ofIntInt} is executed,\n * otherwise throws IllegalArgumentException.\n *\n * @param {Year|number} year\n * @param {Quarter|number} quarter\n * @return {YearQuarter}\n */\n static of(year, quarter) {\n if (year instanceof Year && quarter instanceof Quarter) {\n return YearQuarter._ofYearQuarter(year, quarter);\n }\n if (year instanceof Year && typeof quarter === 'number') {\n return YearQuarter._ofYearInt(year, quarter);\n }\n if (typeof year === 'number' && quarter instanceof Quarter) {\n return YearQuarter._ofIntQuarter(year, quarter);\n }\n if (typeof year === 'number' && typeof quarter === 'number') {\n return YearQuarter._ofIntInt(year, quarter);\n }\n // FIXME\n const yearMessage = `year must be an instance of Year or number but is ${year.constructor.name}`;\n const quarterMessage = `quarter must be an instance of Quarter or number but is ${quarter.constructor.name}`;\n throw new IllegalArgumentException(`${yearMessage} and ${quarterMessage}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {Year} year - the year to represent, not null\n * @param {Quarter} quarter - the quarter-of-year to represent, not null\n * @return {YearQuarter} the year-quarter, not null\n * @protected\n */\n // FIXME ambiguous name?\n static _ofYearQuarter(year, quarter) {\n return YearQuarter.of(year.value(), quarter);\n }\n\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {Year} year - the year to represent, not null\n * @param {number} quarter - the quarter-of-year to represent, from 1 to 4\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if the quarter value is invalid\n * @protected\n */\n static _ofYearInt(year, quarter) {\n return YearQuarter.of(year.value(), Quarter.of(quarter));\n }\n\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {Quarter} quarter - the quarter-of-year to represent, not null\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if the year value is invalid\n * @protected\n */\n static _ofIntQuarter(year, quarter) {\n ChronoField.YEAR.checkValidValue(year);\n requireNonNull(quarter, 'quarter');\n return new YearQuarter(year, quarter);\n }\n\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} quarter - the quarter-of-year to represent, from 1 to 4\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if either field value is invalid\n * @protected\n */\n static _ofIntInt(year, quarter) {\n ChronoField.YEAR.checkValidValue(year);\n return new YearQuarter(year, Quarter.of(quarter));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `YearQuarter` from a temporal object.\n * \n * This obtains a year-quarter based on the specified temporal.\n * A `TemporalAccessor` represents an arbitrary set of date and time information,\n * which this factory converts to an instance of `YearQuarter`.\n * \n * The conversion extracts the {@link ChronoField.YEAR} and\n * {@link IsoFields.QUARTER_OF_YEAR} fields.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a `LocalDate`.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, `YearQuarter.FROM`.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if unable to convert to a `YearQuarter`\n */\n static from(temporal) {\n if (temporal instanceof YearQuarter) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }\n */\n // need to use getLong() as JDK Parsed class get() doesn't work properly\n const year = MathUtil.safeToInt(temporal.getLong(ChronoField.YEAR));\n const qoy = MathUtil.safeToInt(temporal.getLong(IsoFields.QUARTER_OF_YEAR));\n return YearQuarter.of(year, qoy);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain YearQuarter from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `YearQuarter` from a text string using a specific formatter.\n * \n * The text is parsed using the formatter, returning a year-quarter.\n *\n * @param {string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=YearQuarter.PARSER] - the formatter to use, default is {@link YearQuarter.PARSER}\n * @return {YearQuarter} the parsed year-quarter, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = YearQuarter.PARSER) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.parse(text, YearQuarter.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {number} year - the year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {Quarter} quarter - the quarter-of-year to represent, validated not null\n * @private\n */\n constructor(year, quarter) {\n super();\n this._year = MathUtil.safeToInt(year);\n this._quarter = requireInstance(quarter, Quarter, 'Quarter');\n }\n\n /**\n * Returns a copy of this year-quarter with the new year and quarter, checking\n * to see if a new object is in fact required.\n *\n * @param {number} newYear - the year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {Quarter} newQuarter - the quarter-of-year to represent, validated not null\n * @return {YearQuarter} the year-quarter, not null\n * @private\n */\n _with(newYear, newQuarter) {\n if (this._year === newYear && this._quarter === newQuarter) {\n return this;\n }\n return new YearQuarter(newYear, newQuarter);\n }\n\n /**\n * function overloading for {@link YearWeek.isSupported}\n * - if called with an instance of {@link TemporalField}, then {@link YearWeek.isSupportedField} is executed,\n * - if called with an instance of {@link TemporalUnit}, then {@link YearWeek.isSupportedUnit} is executed,\n * - otherwise {@link IllegalArgumentException} is thrown.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit\n * @return {boolean}\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof TemporalField) {\n return this._isSupportedField(fieldOrUnit);\n }\n if (fieldOrUnit instanceof TemporalUnit) {\n return this._isSupportedUnit(fieldOrUnit);\n }\n if (fieldOrUnit == null) {\n return false;\n }\n throw new IllegalArgumentException(`fieldOrUnit must be an instance of TemporalField or TemporalUnit, but is ${fieldOrUnit.constructor.name}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this year-quarter can be queried for the specified field.\n * If false, then calling the {@link YearQuarter.range},\n * {@link YearQuarter.get} and {@link YearQuarter.with}\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * \n * - `QUARTER_OF_YEAR`\n * - `YEAR_OF_ERA`\n * - `YEAR`\n * - `ERA`\n * \n * All other `ChronoField` instances will return false.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this year-quarter, false if not\n * @protected\n */\n _isSupportedField(field) {\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return true;\n } else if (field instanceof ChronoField) {\n return field === ChronoField.YEAR || field === ChronoField.YEAR_OF_ERA || field === ChronoField.ERA;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n * \n * This checks if the specified unit can be added to, or subtracted from, this year-quarter.\n * If false, then calling the {@link YearQuarter.plus} and\n * {@link YearQuarter.minus} methods will throw an exception.\n * \n * If the unit is a {@link ChronoUnit} then the query is implemented here.\n * The supported units are:\n * \n * - `QUARTER_YEARS`\n * - `YEARS`\n * - `DECADES`\n * - `CENTURIES`\n * - `MILLENNIA`\n * - `ERAS`\n * \n * All other `ChronoUnit` instances will return false.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.isSupportedBy(Temporal)`\n * passing `this` as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if the unit can be added/subtracted, false if not\n * @protected\n */\n _isSupportedUnit(unit) {\n if (unit === IsoFields.QUARTER_YEARS) {\n return true;\n } else if (unit instanceof ChronoUnit) {\n return unit === ChronoUnit.YEARS || unit === ChronoUnit.DECADES || unit === ChronoUnit.CENTURIES || unit === ChronoUnit.MILLENNIA || unit === ChronoUnit.ERAS;\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This year-quarter is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link YearQuarter.isSupported} supported fields will return\n * appropriate range instances.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return IsoFields.QUARTER_OF_YEAR.range();\n }\n if (field === ChronoField.YEAR_OF_ERA) {\n return (this.year() <= 0 ? ValueRange.of(1, Year.MAX_VALUE + 1) : ValueRange.of(1, Year.MAX_VALUE));\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this year-quarter as an `int`.\n * \n * This queries this year-quarter for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link YearQuarter.isSupported} supported fields will return valid\n * values based on this year-quarter,.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this year-quarter as a `long`.\n * \n * This queries this year-quarter for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link YearQuarter.isSupported} supported fields will return valid\n * values based on this year-quarter.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return this._quarter.value();\n } else if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.YEAR_OF_ERA:\n return (this._year < 1 ? 1 - this._year : this._year);\n case ChronoField.YEAR:\n return this._year;\n case ChronoField.ERA:\n return (this._year < 1 ? 0 : 1);\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n }\n return super.get(field);\n }\n\n /**\n * @private\n */\n _prolepticQuarter() {\n return this._year * 4 + (this._quarter.value() - 1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n * \n * This method returns the primitive `int` value for the year.\n * \n * The year returned by this method is proleptic as per `get(YEAR)`.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._year;\n }\n\n /**\n * Gets the quarter-of-year field from 1 to 4.\n * \n * This method returns the quarter as an `int` from 1 to 4.\n * Application code is frequently clearer if the enum {@link Quarter}\n * is used by calling {@link YearQuarter.getQuarter}.\n *\n * @return {number} the quarter-of-year, from 1 to 4\n * @see {@link YearQuarter.quarter}\n */\n quarterValue() {\n return this._quarter.value();\n }\n\n /**\n * Gets the quarter-of-year field using the `Quarter` enum.\n * \n * This method returns the enum {@link Quarter} for the quarter.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link Quarter.value}.\n *\n * @return {Quarter} the quarter-of-year, not null\n * @see {@link YearQuarter.quarterValue}\n */\n quarter() {\n return this._quarter;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n * \n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n * \n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n * \n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @return {boolean} true if the year is leap, false otherwise\n */\n isLeapYear() {\n return IsoChronology.isLeapYear(this._year);\n }\n\n /**\n * Checks if the day-of-quarter is valid for this year-quarter.\n * \n * This method checks whether this year and quarter and the input day form\n * a valid date.\n *\n * @param {number} dayOfQuarter - the day-of-quarter to validate, from 1 to 92, invalid value returns false\n * @return {boolean} true if the day is valid for this year-quarter\n */\n isValidDay(dayOfQuarter) {\n return dayOfQuarter >= 1 && dayOfQuarter <= this.lengthOfQuarter();\n }\n\n /**\n * Returns the length of the quarter, taking account of the year.\n * \n * This returns the length of the quarter in days.\n *\n * @return {number} the length of the quarter in days, from 90 to 92\n */\n lengthOfQuarter() {\n return this._quarter.length(this.isLeapYear());\n }\n\n /**\n * Returns the length of the year.\n * \n * This returns the length of the year in days, either 365 or 366.\n *\n * @return {number} 366 if the year is leap, 365 otherwise\n */\n lengthOfYear() {\n return (this.isLeapYear() ? 366 : 365);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this year-quarter.\n * \n * This returns a {@code YearQuarter} based on this one, with the year-quarter adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n * \n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the year-quarter to the next quarter that\n * Halley's comet will pass the Earth.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto(Temporal)} method on the\n * specified adjuster passing {@code this} as the argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {YearQuarter} based on {@code this} with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof YearQuarter) {\n return adjuster;\n }\n return super._withAdjuster(adjuster);\n }\n\n /**\n * Returns a copy of this year-quarter with the specified field set to a new value.\n * \n * This returns a `YearQuarter` based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year or quarter.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n * - `QUARTER_OF_YEAR` -\n * Returns a `YearQuarter` with the specified quarter-of-year.\n * The year will be unchanged.\n * - `YEAR_OF_ERA` -\n * Returns a `YearQuarter` with the specified year-of-era\n * The quarter and era will be unchanged.\n * - `YEAR` -\n * Returns a `YearQuarter` with the specified year.\n * The quarter will be unchanged.\n * - `ERA` -\n * Returns a `YearQuarter` with the specified era.\n * The quarter and year-of-era will be unchanged.\n * \n * In all cases, if the new value is outside the valid range of values for the field\n * then a `DateTimeException` will be thrown.\n * \n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.adjustInto(Temporal, long)`\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {YearQuarter} a `YearQuarter` based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withField(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return this.withQuarter(IsoFields.QUARTER_OF_YEAR.range().checkValidIntValue(newValue, IsoFields.QUARTER_OF_YEAR));\n } else if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.YEAR_OF_ERA:\n return this.withYear(this._year < 1 ? 1 - newValue : newValue);\n case ChronoField.YEAR:\n return this.withYear(newValue);\n case ChronoField.ERA:\n return this.getLong(ChronoField.ERA) === newValue ? this : this.withYear(1 - this._year);\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `YearQuarter` with the year altered.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year - the year to set in the returned year-quarter, from MIN_YEAR to MAX_YEAR\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n ChronoField.YEAR.checkValidValue(year);\n return this._with(year, this._quarter);\n }\n\n /**\n * Returns a copy of this `YearQuarter` with the quarter-of-year altered.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quarter - the quarter-of-year to set in the returned year-quarter, from 1 to 4\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the requested quarter, not null\n * @throws {DateTimeException} if the quarter-of-year value is invalid\n */\n withQuarter(quarter) {\n IsoFields.QUARTER_OF_YEAR.range().checkValidValue(quarter, IsoFields.QUARTER_OF_YEAR);\n return this._with(this._year, Quarter.of(quarter));\n }\n\n /**\n * Returns a copy of this year-quarter with the specified amount added.\n * \n * This returns a `YearQuarter` based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoUnit} then the addition is implemented here.\n * The supported fields behave as follows:\n * \n * - `QUARTER_YEARS` -\n * Returns a `YearQuarter` with the specified number of quarters added.\n * This is equivalent to {@link YearQuarter.plusQuarters}.\n * - `YEARS` -\n * Returns a `YearQuarter` with the specified number of years added.\n * This is equivalent to {@link YearQuarter.plusYears}.\n * - `DECADES` -\n * Returns a `YearQuarter` with the specified number of decades added.\n * This is equivalent to calling {@link YearQuarter.plusYears} with the amount\n * multiplied by 10.\n * - `CENTURIES` -\n * Returns a `YearQuarter` with the specified number of centuries added.\n * This is equivalent to calling {@link YearQuarter.plusYears} with the amount\n * multiplied by 100.\n * - `MILLENNIA` -\n * Returns a `YearQuarter` with the specified number of millennia added.\n * This is equivalent to calling {@link YearQuarter.plusYears} with the amount\n * multiplied by 1,000.\n * - `ERAS` -\n * Returns a `YearQuarter` with the specified number of eras added.\n * Only two eras are supported so the amount must be one, zero or minus one.\n * If the amount is non-zero then the year is changed such that the year-of-era\n * is unchanged.\n * \n * All other `ChronoUnit` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.addTo(Temporal, long)`\n * passing `this` as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to add, not null\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the specified amount added, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _plusUnit(amountToAdd, unit) {\n if (unit === IsoFields.QUARTER_YEARS) {\n return this.plusQuarters(amountToAdd);\n } else if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.YEARS:\n return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES:\n return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES:\n return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA:\n return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS:\n return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in years added.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToAdd - the years to add, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n const newYear = ChronoField.YEAR.checkValidIntValue(this._year + yearsToAdd); // safe overflow\n return this._with(newYear, this._quarter);\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in quarters added.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quartersToAdd - the quarters to add, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the quarters added, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n plusQuarters(quartersToAdd) {\n if (quartersToAdd === 0) {\n return this;\n }\n const quarterCount = this._year * 4 + (this._quarter.value() - 1);\n const calcQuarters = quarterCount + quartersToAdd; // safe overflow\n const newYear = ChronoField.YEAR.checkValidIntValue(MathUtil.intDiv(calcQuarters, 4));\n const newQuarter = MathUtil.floorMod(calcQuarters, 4) + 1;\n return this._with(newYear, Quarter.of(newQuarter));\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in years subtracted.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToSubtract - the years to subtract, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n minusYears(yearsToSubtract) {\n return (yearsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusYears(MathUtil.MIN_SAFE_INTEGER).plusYears(1) : this.plusYears(-yearsToSubtract));\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in quarters subtracted.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quartersToSubtract - the quarters to subtract, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the quarters subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n minusQuarters(quartersToSubtract) {\n return (quartersToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusQuarters(MathUtil.MIN_SAFE_INTEGER).plusQuarters(1) : this.plusQuarters(-quartersToSubtract));\n\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year-quarter using the specified query.\n * \n * This queries this year-quarter using the specified query strategy object.\n * The `TemporalQuery` object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return IsoFields.QUARTER_YEARS;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this year-quarter.\n * \n * This returns a temporal object of the same observable type as the input\n * with the year and quarter changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.plus}\n * passing the number of quarters to adjust by.\n * If the specified temporal object does not use the ISO calendar system then\n * a `DateTimeException` is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisYearQuarter.adjustInto(temporal);\n * temporal = temporal.with(thisYearQuarter);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }*/\n const newProlepticQuarter = this._prolepticQuarter();\n const oldProlepticQuarter = temporal.get(ChronoField.YEAR) * 4 + (temporal.get(IsoFields.QUARTER_OF_YEAR) - 1);\n return temporal.plus(newProlepticQuarter - oldProlepticQuarter, IsoFields.QUARTER_YEARS);\n }\n\n /**\n * Calculates the amount of time until another year-quarter in terms of the specified unit.\n * \n * This calculates the amount of time between two `YearQuarter`\n * objects in terms of a single `TemporalUnit`.\n * The start and end points are `this` and the specified year-quarter.\n * The result will be negative if the end is before the start.\n * The `Temporal` passed to this method is converted to a\n * `YearQuarter` using {@link YearQuarter.from}.\n * For example, the period in years between two year-quarters can be calculated\n * using `startYearQuarter.until(endYearQuarter, YEARS)`.\n * \n * The calculation returns a whole number, representing the number of\n * complete units between the two year-quarters.\n * For example, the period in decades between 2012-Q3 and 2032-Q2\n * will only be one decade as it is one quarter short of two decades.\n * \n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit.between}:\n * <pre>\n * // these two lines are equivalent\n * amount = start.until(end, QUARTER_YEARS);\n * amount = QUARTER_YEARS.between(start, end);\n * </pre>\n * The choice should be made based on which makes the code more readable.\n * \n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units `QUARTER_YEARS`, `YEARS`, `DECADES`,\n * `CENTURIES`, `MILLENNIA` and `ERAS` are supported.\n * Other `ChronoUnit` values will throw an exception.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.between(Temporal, Temporal)`\n * passing `this` as the first argument and the converted input temporal\n * as the second argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date, exclusive, which is converted to a `YearQuarter`, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this year-quarter and the end year-quarter\n * @throws {DateTimeException} if the amount cannot be calculated, or the end\n * temporal cannot be converted to a `YearQuarter`\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n requireInstance(endExclusive, Temporal, 'endExclusive');\n requireInstance(unit, TemporalUnit, 'unit');\n\n const end = YearQuarter.from(endExclusive);\n const quartersUntil = end._prolepticQuarter() - this._prolepticQuarter(); // no overflow\n if (unit === IsoFields.QUARTER_YEARS) {\n return quartersUntil;\n } else if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.YEARS:\n return MathUtil.intDiv(quartersUntil, 4);\n case ChronoUnit.DECADES:\n return MathUtil.intDiv(quartersUntil, 40);\n case ChronoUnit.CENTURIES:\n return MathUtil.intDiv(quartersUntil, 400);\n case ChronoUnit.MILLENNIA:\n return MathUtil.intDiv(quartersUntil, 4000);\n case ChronoUnit.ERAS:\n return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n }\n return unit.between(this, end);\n }\n\n /**\n * Formats this year-quarter using the specified formatter.\n * \n * This year-quarter will be passed to the formatter to produce a string.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted year-quarter string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year-quarter with a day-of-quarter to create a `LocalDate`.\n * \n * This returns a `LocalDate` formed from this year-quarter and the specified day-of-quarter.\n * \n * The day-of-quarter value must be valid for the year-quarter.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = yearQuarter.atDay(day);\n * ```\n *\n * @param {number} dayOfQuarter the day-of-quarter to use, from 1 to 92\n * @return {LocalDate} the date formed from this year-quarter and the specified day, not null\n * @throws {DateTimeException} if the day is invalid for the year-quarter\n * @see {@link YearQuarter.isValidDay}\n */\n atDay(dayOfQuarter) {\n ValueRange.of(1, this.lengthOfQuarter()).checkValidValue(dayOfQuarter, IsoFields.DAY_OF_QUARTER);\n const leap = Year.isLeap(this._year);\n let month = this._quarter.firstMonth();\n while (dayOfQuarter > month.length(leap)) {\n dayOfQuarter -= month.length(leap);\n month = month.plus(1);\n }\n return LocalDate.of(this._year, month, dayOfQuarter);\n }\n\n /**\n * Returns a `LocalDate` at the end of the quarter.\n * \n * This returns a `LocalDate` based on this year-quarter.\n * The day-of-quarter is set to the last valid day of the quarter, taking\n * into account leap years.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = year.atQuarter(quarter).atEndOfQuarter();\n * ```\n *\n * @return {LocalDate} the last valid date of this year-quarter, not null\n */\n atEndOfQuarter() {\n const month = this._quarter.firstMonth().plus(2);\n return LocalDate.of(this._year, month, month.maxLength());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this year-quarter to another\n * \n * The comparison is based first on the value of the year, then on the value of the quarter.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param {YearQuarter} other - the other year-quarter to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, YearQuarter, 'other');\n let cmp = (this._year - other._year);\n if (cmp === 0) {\n cmp = this._quarter.compareTo(other._quarter);\n }\n return cmp;\n }\n\n /**\n * Is this year-quarter after the specified year-quarter.\n *\n * @param {YearQuarter} other - the other year-quarter to compare to, not null\n * @return {boolean} true if this is after the specified year-quarter\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this year-quarter before the specified year-quarter.\n *\n * @param {YearQuarter} other - the other year-quarter to compare to, not null\n * @return {boolean} true if this point is before the specified year-quarter\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this year-quarter is equal to another year-quarter.\n * \n * The comparison is based on the time-line position of the year-quarters.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other year-quarter\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof YearQuarter) {\n const other = obj;\n return this._year === other._year && this._quarter === other._quarter;\n }\n return false;\n }\n\n /**\n * A hash code for this year-quarter.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._year ^ (this._quarter.value() << 27);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this year-quarter as a `String`, such as `2007-Q2`.\n * \n * The output will be in the format `uuuu-'Q'Q`:\n *\n * @return {string} a string representation of this year-quarter, not null\n */\n toString() {\n let yearString;\n const yearValue = this._year;\n const absYear = Math.abs(yearValue);\n if (absYear < 1000) {\n if (yearValue < 0) {\n yearString = `-${(`${yearValue - 10000}`).slice(-4)}`;\n } else {\n yearString = (`${yearValue + 10000}`).slice(-4);\n }\n } else {\n if (yearValue > 9999) {\n yearString = `+${yearValue}`;\n } else {\n yearString = `${yearValue}`;\n }\n }\n return yearString.concat('-').concat(this._quarter);\n }\n}\n\nexport function _init() {\n YearQuarter.PARSER = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendLiteral('Q')\n .appendValue(IsoFields.QUARTER_OF_YEAR, 1)\n .toFormatter();\n\n YearQuarter.FROM = createTemporalQuery('YearQuarter.FROM', (temporal) => {\n return YearQuarter.from(temporal);\n });\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, ChronoUnit, Clock, DateTimeException, DateTimeFormatterBuilder, DayOfWeek, IllegalArgumentException, IsoChronology, IsoFields, LocalDate, NullPointerException, SignStyle, Temporal, TemporalField, TemporalQueries, TemporalQuery, TemporalUnit, UnsupportedTemporalTypeException, ValueRange, Year, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { assert, requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A year-week in the ISO week date system such as `2015-W13`\n * \n * {@link YearWeek} is an immutable date-time object that represents the combination\n * of a week-based-year and week-of-week-based-year.\n * Any field that can be derived from those two fields can be obtained.\n * \n * This class does not store or represent a day, time or time-zone.\n * For example, the value '13th week of 2007' can be stored in a {@link YearWeek}.\n * \n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n * \n * ISO-8601 defines the week as always starting with Monday.\n * The first week is the week which contains the first Thursday of the calendar year.\n * As such, the week-based-year used in this class does not align with the calendar year.\n */\nexport class YearWeek extends Temporal {\n /**\n * Function overloading for {@link YearWeek.now}:\n * - if called with no arguments, {@link YearWeek._now0} is executed;\n * - if called with an instance of {@link ZoneId}, then {@link YearWeek._nowZoneId} is executed;\n * - if called with an instance of {@link Clock}, then {@link YearWeek._nowClock} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {YearWeek}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return YearWeek._now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return YearWeek._nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return YearWeek._nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current year-week from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current year-week.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {YearWeek} the current year-week using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return YearWeek.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year-week from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current year-week.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {YearWeek} the current year-week using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return YearWeek.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current year-week from the specified clock.\n * \n * This will query the specified clock to obtain the current year-week.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {YearWeek} the current year-week, not null\n * @protected\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return YearWeek.of(now.get(IsoFields.WEEK_BASED_YEAR), now.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Function overloading for {@link YearWeek.of}:\n * - if called with an instances of {@link Year} and `int`, then {@link YearWeek._ofYearWeek} is executed;\n * - if called with an instances of number and `int`, then {@link YearWeek._ofWeekBasedYear} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {Year|number} year - the year to represent, not null\n * @param {number} week - the week-of-week-based-year to represent, from 1 to 53\n * @return {YearWeek} the year-week, not null\n */\n static of(year, week) {\n MathUtil.verifyInt(week);\n if (year instanceof Year) {\n return this._ofYearWeek(year, week);\n } else {\n MathUtil.verifyInt(year);\n return this._ofWeekBasedYear(year, week);\n }\n }\n\n /**\n * Obtains an instance of {@link YearWeek} from a year and week.\n * \n * If the week is 53 and the year does not have 53 weeks, week one of the following\n * year is selected.\n * \n * Note that this class is based on the week-based-year which aligns to Monday to Sunday weeks,\n * whereas {@link Year} is intended to represent standard years aligned from January to December.\n * This difference may be seen at the start and/or end of the year.\n * This method treats the standard year as though it is the week-based-year.\n * Thus, `YearWeek.of(Year.of(2020), 1)` creates an object where Monday and Tuesday of the week\n * are actually the last two days of 2019.\n *\n * @param {Year} year - the year to represent, not null\n * @param {number} week - the week-of-week-based-year to represent, from 1 to 53\n * @return {YearWeek} the year-week, not null\n * @throws {DateTimeException} if the week value is invalid\n * @protected\n */\n static _ofYearWeek(year, week) {\n const weekBasedYear = year.value();\n return this._ofWeekBasedYear(weekBasedYear, week);\n }\n\n /**\n * Obtains an instance of {@link YearWeek} from a week-based-year and week.\n * \n * If the week is 53 and the year does not have 53 weeks, week one of the following\n * year is selected.\n *\n * @param {number} weekBasedYear - the week-based-year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} week - the week-of-week-based-year to represent, from 1 to 53\n * @return {YearWeek} the year-week, not null\n * @throws {DateTimeException} if either field is invalid\n * @protected\n */\n static _ofWeekBasedYear(weekBasedYear, week) {\n IsoFields.WEEK_BASED_YEAR.range().checkValidValue(weekBasedYear, IsoFields.WEEK_BASED_YEAR);\n IsoFields.WEEK_OF_WEEK_BASED_YEAR.range().checkValidValue(week, IsoFields.WEEK_OF_WEEK_BASED_YEAR);\n if (week === 53 && YearWeek._weekRange(weekBasedYear) < 53) {\n week = 1;\n weekBasedYear++;\n IsoFields.WEEK_BASED_YEAR.range().checkValidValue(weekBasedYear, IsoFields.WEEK_BASED_YEAR);\n }\n return new YearWeek(weekBasedYear, week);\n }\n\n /**\n * from IsoFields in ThreeTen-Backport\n * @private\n */\n static _weekRange(weekBasedYear) {\n const date = LocalDate.of(weekBasedYear, 1, 1);\n // 53 weeks if year starts on Thursday, or Wed in a leap year\n if (date.dayOfWeek() === DayOfWeek.THURSDAY || (date.dayOfWeek() === DayOfWeek.WEDNESDAY && date.isLeapYear())) {\n return 53;\n }\n return 52;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link YearWeek} from a temporal object.\n * \n * This obtains a year-week based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link YearWeek}.\n * \n * The conversion extracts the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link YearWeek.FROM}.\n *\n * @param {Temporal} temporal - the temporal object to convert, not null\n * @return {YearWeek} the year-week, not null\n * @throws {DateTimeException} if unable to convert to a {@link YearWeek}\n */\n static from(temporal) {\n if (temporal instanceof YearWeek) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (!IsoChronology.INSTANCE.equals(Chronology.from(temporal))) {\n temporal = LocalDate.from(temporal);\n }*/\n // need to use getLong() as JDK Parsed class get() doesn't work properly\n const year = MathUtil.safeToInt(temporal.getLong(IsoFields.WEEK_BASED_YEAR));\n const week = MathUtil.safeToInt(temporal.getLong(IsoFields.WEEK_OF_WEEK_BASED_YEAR));\n return YearWeek.of(year, week);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain YearWeek from TemporalAccessor: ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link YearWeek} from a text string using a specific formatter.\n * \n * The text is parsed using the formatter, returning a year-week.\n *\n * @param {string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=YearWeek.PARSER] - the formatter to use, default is\n * {@link YearWeek.PARSER}\n * \n * @return {YearWeek} the parsed year-week, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = YearWeek.PARSER) {\n assert(formatter != null, 'formatter', NullPointerException);\n return formatter.parse(text, YearWeek.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {number} weekBasedYear - the week-based-year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {number} week - the week to represent, validated\n * @private\n */\n constructor(weekBasedYear, week) {\n super();\n this._year = weekBasedYear;\n this._week = week;\n }\n\n /**\n * function overloading for {@link YearWeek.isSupported}\n * - if called with an instance of {@link TemporalField}, then {@link YearWeek._isSupportedField} is executed,\n * - if called with an instance of {@link TemporalUnit}, then {@link YearWeek._isSupportedUnit} is executed,\n * - otherwise {@link IllegalArgumentException} is thrown.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit\n * @return {boolean}\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof TemporalField) {\n return this._isSupportedField(fieldOrUnit);\n }\n if (fieldOrUnit instanceof TemporalUnit) {\n return this._isSupportedUnit(fieldOrUnit);\n }\n if (fieldOrUnit == null) {\n return false;\n }\n throw new IllegalArgumentException(`fieldOrUnit must be an instance of TemporalField or TemporalUnit, but is ${fieldOrUnit.constructor.name}`);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this year-week can be queried for the specified field.\n * If false, then calling the {@link YearWeek.range} range and\n * {@link YearWeek.get} get methods will throw an exception.\n * \n * The supported fields are:\n * <ul>\n * <li>{@link IsoFields.WEEK_OF_WEEK_BASED_YEAR}\n * <li>{@link IsoFields.WEEK_BASED_YEAR}\n * </ul>\n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this year-week, false if not\n * @protected\n */\n _isSupportedField(field) {\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR || field === IsoFields.WEEK_BASED_YEAR) {\n return true;\n } else if (field instanceof ChronoField) {\n return false;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n * \n * This checks if the specified unit can be added to, or subtracted from, this date-time.\n * If false, then calling the {@link YearWeek.plus} and\n * {@link YearWeek.minus} minus methods will throw an exception.\n * \n * The supported units are:\n * - {@link ChronoUnit.WEEKS}\n * - {@link IsoFields.WEEK_BASED_YEARS}\n * \n * All other {@link ChronoUnit} instances will return false.\n * \n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.isSupportedBy}\n * passing this as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if the unit can be added/subtracted, false if not\n * @protected\n */\n _isSupportedUnit(unit) {\n if (unit === ChronoUnit.WEEKS || unit === IsoFields.WEEK_BASED_YEARS) {\n return true;\n } else if (unit instanceof ChronoUnit) {\n return false;\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This year-week is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * The range for the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields is returned.\n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.WEEK_BASED_YEAR) {\n return IsoFields.WEEK_BASED_YEAR.range();\n }\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR) {\n return ValueRange.of(1, YearWeek._weekRange(this._year));\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this year-week as an `int`.\n * \n * This queries this year-week for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * The value for the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields is returned.\n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this year-week as a `long`.\n * \n * This queries this year-week for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * The value for the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields is returned.\n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.WEEK_BASED_YEAR) {\n return this._year;\n }\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR) {\n return this._week;\n }\n if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the week-based-year field.\n * \n * This method returns the primitive `int` value for the week-based-year.\n * \n * Note that the ISO week-based-year does not align with the standard Gregorian/ISO calendar year.\n *\n * @return {number} the week-based-year\n */\n year() {\n return this._year;\n }\n\n /**\n * Gets the week-of-week-based-year field.\n * \n * This method returns the primitive `int` value for the week of the week-based-year.\n *\n * @return {number} the week-of-week-based-year\n */\n week() {\n return this._week;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the week-based-year has 53 weeks.\n * \n * This determines if the year has 53 weeks, returning true.\n * If false, the year has 52 weeks.\n *\n * @return {boolean} true if the year has 53 weeks, false otherwise\n */\n is53WeekYear() {\n return YearWeek._weekRange(this._year) === 53;\n }\n\n /**\n * Returns the length of the week-based-year.\n * \n * This returns the length of the year in days, either 364 or 371.\n *\n * @return {number} 364 if the year has 52 weeks, 371 if it has 53 weeks\n */\n lengthOfYear() {\n return (this.is53WeekYear() ? 371 : 364);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this year-week.\n * \n * This returns a {@link YearWeek}, based on this one, with the year-week adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalAdjusteradjustInto} method on the\n * specified adjuster passing this as the argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - adjuster the adjuster to use, not null\n * @return {YearWeek} a year-week based on this with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof YearWeek) {\n return adjuster;\n }\n return super._withAdjuster(adjuster);\n }\n\n /**\n * Returns a copy of this year-week with the specified field set to a new value.\n * \n * This returns a {@link YearWeek}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year or week.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n * - {@link WEEK_OF_WEEK_BASED_YEAR} - Returns a {@link YearWeek} with the specified week-of-year set as per {@link YearWeek.withWeek}.\n * - {@link WEEK_BASED_YEAR} - Returns a {@link YearWeek} with the specified year set as per {@link YearWeek.withYear}.\n * \n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing this as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {YearWeek} a year-week based on this with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withField(field, newValue) {\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR) {\n return this.withWeek(IsoFields.WEEK_OF_WEEK_BASED_YEAR.range().checkValidIntValue(newValue, IsoFields.WEEK_OF_WEEK_BASED_YEAR));\n } else if (field === IsoFields.WEEK_BASED_YEAR) {\n return this.withYear(IsoFields.WEEK_BASED_YEAR.range().checkValidIntValue(newValue, IsoFields.WEEK_BASED_YEAR));\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * Returns a copy of this {@link YearWeek} with the week-based-year altered.\n * \n * This returns a year-week with the specified week-based-year.\n * If the week of this instance is 53 and the new year does not have 53 weeks,\n * the week will be adjusted to be 52.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weekBasedYear - the week-based-year to set in the returned year-week\n * @return {YearWeek} a year-week based on this year-week with the requested year, not null\n * @throws {DateTimeException} if the week-based-year value is invalid\n */\n withYear(weekBasedYear) {\n if (this._week === 53 && YearWeek._weekRange(weekBasedYear) < 53) {\n return YearWeek.of(weekBasedYear, 52);\n }\n return YearWeek.of(weekBasedYear, this._week);\n }\n\n /**\n * Returns a copy of this {@link YearWeek} with the week altered.\n * \n * This returns a year-week with the specified week-of-week-based-year.\n * If the new week is 53 and the year does not have 53 weeks, week one of the\n * following year is selected.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} week - the week-of-week-based-year to set in the returned year-week\n * @return {YearWeek} a year-week based on this year-week with the requested week, not null\n * @throws {DateTimeException} if the week-of-week-based-year value is invalid\n */\n withWeek(week) {\n return YearWeek.of(this._year, week);\n }\n\n /**\n * Returns a copy of this year-week with the specified amount added.\n * \n * This returns a {@link YearWeek}, based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoUnit} then the addition is implemented here.\n * The supported fields behave as follows:\n * - {@link WEEKS} - Returns a {@link YearWeek} with the weeks added as per {@link YearWeek.plusWeeks}.\n * - {@link WEEK_BASED_YEARS} - Returns a {@link YearWeek} with the years added as per {@link YearWeek.plusYears}.\n * \n * All {@link ChronoUnit} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.addTo}\n * passing this as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to add, not null\n * @return {YearWeek} a year-week based on this year-week with the specified amount added, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _plusUnit(amountToAdd, unit) {\n if (unit === ChronoUnit.WEEKS) {\n return this.plusWeeks(amountToAdd);\n } else if (unit === IsoFields.WEEK_BASED_YEARS) {\n return this.plusYears(amountToAdd);\n } else if (unit instanceof ChronoUnit) {\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of years added.\n * \n * If the week of this instance is 53 and the new year does not have 53 weeks,\n * the week will be adjusted to be 52.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} yearsToAdd - the years to add, may be negative\n * @return {YearWeek} the year-week with the years added, not null\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n const newYear = MathUtil.safeToInt(MathUtil.safeAdd(this._year, yearsToAdd));\n return this.withYear(newYear);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of weeks added.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} weeksToAdd - the weeks to add, may be negative\n * @return {YearWeek} the year-week with the weeks added, not null\n */\n plusWeeks(weeksToAdd) {\n if (weeksToAdd === 0) {\n return this;\n }\n const mondayOfWeek = this.atDay(DayOfWeek.MONDAY).plusWeeks(weeksToAdd);\n return YearWeek.from(mondayOfWeek);\n }\n\n /**\n * Returns a copy of this year-week with the specified amount subtracted.\n * \n * This returns a {@link YearWeek}, based on this one, with the amount\n * in terms of the unit subtracted. If it is not possible to subtract the amount,\n * because the unit is not supported or for some other reason, an exception is thrown.\n * \n * This method is equivalent to {@link YearWeek.plus} with the amount negated.\n * See that method for a full description of how addition, and thus subtraction, works.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToSubtract - the amount of the unit to subtract from the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to subtract, not null\n * @return {YearWeek} a year-week based on this year-week with the specified amount subtracted, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _minusUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n return this._plusUnit(-amountToSubtract, unit);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of years subtracted.\n * \n * If the week of this instance is 53 and the new year does not have 53 weeks,\n * the week will be adjusted to be 52.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} yearsToSubtract - the years to subtract, may be negative\n * @return {YearWeek} the year-week with the years subtracted, not null\n */\n minusYears(yearsToSubtract) {\n if (yearsToSubtract === 0) {\n return this;\n }\n const newYear = MathUtil.safeToInt(MathUtil.safeSubtract(this._year, yearsToSubtract));\n return this.withYear(newYear);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of weeks subtracted.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} weeksToSubtract - the weeks to subtract, may be negative\n * @return {YearWeek} the year-week with the weeks subtracted, not null\n */\n minusWeeks(weeksToSubtract) {\n if (weeksToSubtract === 0) {\n return this;\n }\n const mondayOfWeek = this.atDay(DayOfWeek.MONDAY).minusWeeks(weeksToSubtract);\n return YearWeek.from(mondayOfWeek);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year-week using the specified query.\n * \n * This queries this year-week using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this year-week.\n * \n * This returns a temporal object of the same observable type as the input\n * with the week-based-year and week changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * twice, passing {@link IsoFields.WEEK_BASED_YEAR} and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} as the fields.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisYearWeek.adjustInto(temporal);\n * temporal = temporal.with(thisYearWeek);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal.with(IsoFields.WEEK_BASED_YEAR, this._year).with(IsoFields.WEEK_OF_WEEK_BASED_YEAR, this._week);\n }\n\n /**\n * Calculates the amount of time until another year-week in terms of the specified unit.\n * \n * This calculates the amount of time between two {@link YearWeek}\n * objects in terms of a single {@link TemporalUnit}.\n * The start and end points are this and the specified year-week.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method is converted to a\n * {@link YearWeek} using {@link YearWeek.from}.\n * For example, the period in years between two year-weeks can be calculated\n * using `startYearWeek.until(endYearWeek, YEARS)`.\n * \n * The calculation returns a whole number, representing the number of\n * complete units between the two year-weeks.\n * For example, the period in years between 2012-W23 and 2032-W22\n * will only be 9 years as it is one week short of 10 years.\n * \n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit.between}:\n * ```\n * // these two lines are equivalent\n * amount = start.until(end, WEEKS);\n * amount = WEEKS.between(start, end);\n * ```\n * The choice should be made based on which makes the code more readable.\n * \n * The calculation is implemented in this method for units {@link WEEKS}\n * and {@link WEEK_BASED_YEARS}.\n * Other {@link ChronoUnit} values will throw an exception.\n * \n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing this as the first argument and the converted input temporal\n * as the second argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date, exclusive, which is converted to a {@link YearWeek}, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this year-week and the end year-week\n * @throws {DateTimeException} if the amount cannot be calculated, or the end\n * temporal cannot be converted to a {@link YearWeek}\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n const end = YearWeek.from(endExclusive);\n if (unit === ChronoUnit.WEEKS) {\n return this._daysUntil(end);\n } else if (unit === IsoFields.WEEK_BASED_YEARS) {\n return this._yearsUntil(end);\n } else if (unit instanceof ChronoUnit) {\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n return unit.between(this, end);\n }\n\n /**\n * @private\n */\n _daysUntil(end) {\n const startDate = this.atDay(DayOfWeek.MONDAY);\n const endDate = end.atDay(DayOfWeek.MONDAY);\n const days = endDate.toEpochDay() - startDate.toEpochDay();\n return MathUtil.intDiv(days, 7);\n }\n\n /**\n * @private\n */\n _yearsUntil(end) {\n const yearsDiff = end._year - this._year;\n if (yearsDiff > 0 && end._week < this._week) {\n return yearsDiff - 1;\n }\n if (yearsDiff < 0 && end._week > this._week) {\n return yearsDiff + 1;\n }\n return yearsDiff;\n }\n\n /**\n * Formats this year-week using the specified formatter.\n * \n * This year-week will be passed to the formatter to produce a string.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted year-week string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year-week with a day-of-week to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this year-week and the specified day-of-Week.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = yearWeek.atDay(MONDAY);\n * ```\n *\n * @param {DayOfWeek} dayOfWeek - the day-of-week to use, not null\n * @return {LocalDate} the date formed from this year-week and the specified day, not null\n */\n atDay(dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n const correction = LocalDate.of(this._year, 1, 4).dayOfWeek().value() + 3;\n const dayOfYear = this._week * 7 + dayOfWeek.value() - correction;\n const maxDaysOfYear = Year.isLeap(this._year) ? 366 : 365;\n if (dayOfYear > maxDaysOfYear) {\n return LocalDate.ofYearDay(this._year + 1, dayOfYear - maxDaysOfYear);\n }\n if (dayOfYear > 0) {\n return LocalDate.ofYearDay(this._year, dayOfYear);\n } else {\n const daysOfPreviousYear = Year.isLeap(this._year - 1) ? 366 : 365;\n return LocalDate.ofYearDay(this._year - 1, daysOfPreviousYear + dayOfYear);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this year-week to another\n * \n * The comparison is based first on the value of the year, then on the value of the week.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {YearWeek} other - the other year-week to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, YearWeek, 'other');\n let cmp = (this._year - other._year);\n if (cmp === 0) {\n cmp = (this._week - other._week);\n }\n return cmp;\n }\n \n /**\n * Is this year-week after the specified year-week.\n *\n * @param {YearWeek} other - the other year-week to compare to, not null\n * @return {boolean} true if this is after the specified year-week\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this year-week before the specified year-week.\n *\n * @param {YearWeek} other - the other year-week to compare to, not null\n * @return {boolean} true if this point is before the specified year-week\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n \n //-----------------------------------------------------------------------\n /**\n * Checks if this year-week is equal to another year-week.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other year-week\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof YearWeek) {\n return this._year === obj._year && this._week === obj._week;\n }\n return false;\n }\n \n /**\n * A hash code for this year-week.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._year ^ (this._week << 25);\n }\n \n //-----------------------------------------------------------------------\n /**\n * Outputs this year-week as a {@link String}, such as `2015-W13`.\n * \n * The output will be in the format `YYYY-'W'ww`:\n *\n * @return {string} a string representation of this year-week, not null\n */\n toString() {\n let yearString;\n const yearValue = this._year;\n const absYear = Math.abs(yearValue);\n if (absYear < 1000) {\n if (yearValue < 0) {\n yearString = `-${(`${yearValue - 10000}`).slice(-4)}`;\n } else {\n yearString = (`${yearValue + 10000}`).slice(-4);\n }\n } else {\n if (yearValue > 9999) {\n yearString = `+${yearValue}`;\n } else {\n yearString = `${yearValue}`;\n }\n }\n return yearString.concat(this._week < 10 ? '-W0' : '-W').concat(this._week);\n }\n}\n\nexport function _init() {\n YearWeek.PARSER = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .appendValue(IsoFields.WEEK_BASED_YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-W')\n .appendValue(IsoFields.WEEK_OF_WEEK_BASED_YEAR, 2)\n .toFormatter();\n\n YearWeek.FROM = createTemporalQuery('YearWeek.FROM', (temporal) => {\n return YearWeek.from(temporal);\n });\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as dayOfMonthInit } from './DayOfMonth';\nimport { _init as dayOfYearInit } from './DayOfYear';\nimport { _init as intervalInit } from './Interval';\nimport { _init as localDateRangeInit } from './LocalDateRange';\nimport { _init as offsetDateInit } from './OffsetDate';\nimport { _init as quarterInit } from './Quarter';\nimport { _init as temporalsInit } from './Temporals';\nimport { _init as yearQuarterInit } from './YearQuarter';\nimport { _init as yearWeekInit } from './YearWeek';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n dayOfMonthInit();\n dayOfYearInit();\n intervalInit();\n localDateRangeInit();\n offsetDateInit();\n quarterInit();\n temporalsInit();\n yearQuarterInit();\n yearWeekInit();\n}\n\ninit();\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { DayOfMonth } from './DayOfMonth';\n// import { DayOfYear } from './DayOfYear';\n// import { Interval } from './Interval';\n// import { LocalDateRange } from './LocalDateRange';\n// import { OffsetDate } from './OffsetDate';\n// import { Quarter } from './Quarter';\n// import { Temporals } from './Temporals';\n// import { YearQuarter } from './YearQuarter';\n// import { YearWeek } from './YearWeek';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.DayOfMonth = DayOfMonth;\n // jsJoda.DayOfYear = DayOfYear;\n // jsJoda.Interval = Interval;\n // jsJoda.LocalDateRange = LocalDateRange;\n // jsJoda.OffsetDate = OffsetDate;\n // jsJoda.Quarter = Quarter;\n // jsJoda.Temporals = Temporals;\n // jsJoda.YearQuarter = YearQuarter;\n // jsJoda.YearWeek = YearWeek;\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { DayOfMonth } from './DayOfMonth';\nimport { DayOfYear } from './DayOfYear';\nimport { Interval } from './Interval';\nimport { LocalDateRange } from './LocalDateRange';\nimport { OffsetDate } from './OffsetDate';\nimport { Quarter } from './Quarter';\nimport { Temporals } from './Temporals';\nimport { YearQuarter } from './YearQuarter';\nimport { YearWeek } from './YearWeek';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n DayOfMonth,\n DayOfYear,\n Interval,\n LocalDateRange,\n OffsetDate,\n Quarter,\n Temporals,\n YearQuarter,\n YearWeek,\n};\n"],"names":["assert","assertion","msg","error","Error","requireNonNull","value","parameterName","NullPointerException","requireInstance","_class","IllegalArgumentException","name","constructor","MathUtil","jodaInternal","DayOfMonth","now","zoneIdOrClock","arguments","length","_now0","ZoneId","_nowZoneId","Clock","_nowClock","systemDefaultZone","zone","system","clock","LocalDate","of","dayOfMonth","VALUES","DateTimeException","from","temporal","get","ChronoField","DAY_OF_MONTH","ex","_day","safeToInt","isSupported","field","isSupportedBy","range","checkValidIntValue","getLong","UnsupportedTemporalTypeException","getFrom","isValidYearMonth","yearMonth","isValidDay","query","TemporalQuery","TemporalQueries","chronology","IsoChronology","INSTANCE","adjustInto","with","atMonth","month","Month","MonthDay","Math","min","maxLength","atYearMonth","atDay","lengthOfMonth","compareTo","other","equals","obj","hashCode","toString","TemporalAccessor","_init","Array","i","DayOfYear","dayOfYear","DAY_OF_YEAR","isValidYear","year","Year","isLeap","atYear","ofYearDay","Interval","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","Instant","isBefore","duration","isNegative","plus","parse","text","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","encloses","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","ALL","MINP1","plusDays","MAXM1","minusDays","LocalDateRange","endExclusiveOrPeriod","_ofLocalDateLocalDate","Period","_ofLocalDatePeriod","messageParts","push","join","period","ofClosed","endInclusive","ofEmpty","date","ofUnbounded","ofUnboundedStart","ofUnboundedEnd","slice","adjuster","localDateOrLocalDateRange","_isAfterLocalDate","_isAfterLocalDateRange","_isBeforeLocalDate","_isBeforeLocalDateRange","lengthInDays","Number","POSITIVE_INFINITY","toEpochDay","toPeriod","ArithmeticException","SECONDS_PER_DAY","OffsetDate","ofInstant","rules","offset","_ofLocalDateZoneOffset","_ofIntIntIntZoneOffset","d","epochSec","epochSecond","totalSeconds","epochDay","floorDiv","ofEpochDay","ZoneOffset","formatter","DateTimeFormatter","ISO_OFFSET_DATE","FROM","_date","_offset","_with","fieldOrUnit","TemporalField","_isSupportedField","TemporalUnit","_isSupportedUnit","isDateBased","OFFSET_SECONDS","unit","ChronoUnit","rangeRefinedBy","withOffsetSameLocal","toLocalDate","monthValue","dayOfWeek","_withAdjuster","_withField","newValue","f","ofTotalSeconds","withYear","withMonth","withDayOfMonth","withDayOfYear","_plusUnit","amountToAdd","addTo","plusYears","years","plusMonths","months","plusWeeks","weeks","days","minusYears","minusMonths","minusWeeks","precision","DAYS","EPOCH_DAY","until","offsetDiff","endLocal","intDiv","format","atTime","time","OffsetDateTime","_toEpochSecond","secs","toEpochSecond","toSecondOfDay","compare","isEqual","Temporal","createTemporalQuery","queryFromFunction","ExtendedTemporalQuery","prototype","queryFrom","Quarter","valueOf","Q1","Q2","Q3","Q4","values","QUARTERS","quarterOfYear","ofMonth","monthOfYear","MONTH_OF_YEAR","checkValidValue","ordinal","qoy","IsoFields","QUARTER_OF_YEAR","_value","_name","displayName","style","locale","quarters","amount","intMod","leapYear","firstMonth","JANUARY","APRIL","JULY","OCTOBER","IllegalStateException","QUARTER_YEARS","Temporals","nextWorkingDay","Adjuster","NEXT_WORKING","nextWorkingDayOrSame","NEXT_WORKING_OR_SAME","previousWorkingDay","PREVIOUS_WORKING","previousWorkingDayOrSame","PREVIOUS_WORKING_OR_SAME","parseFirstMatching","formatters","pp","ParsePosition","parseUnresolved","len","getErrorIndex","getIndex","ignored","convertAmount","fromUnit","toUnit","_validateUnit","_isPrecise","fromNanos","toNanos","multiple","safeMultiply","fromMonthFactor","_monthMonthFactor","toMonthFactor","ERAS","FOREVER","WEEKS","MONTHS","YEARS","DECADES","CENTURIES","MILLENNIA","dow","DAY_OF_WEEK","TemporalAdjuster","YearQuarter","getYear","getMonth","quarter","_ofYearQuarter","_ofYearInt","_ofIntQuarter","_ofIntInt","yearMessage","quarterMessage","YEAR","PARSER","_year","_quarter","newYear","newQuarter","YEAR_OF_ERA","ERA","ValueRange","MAX_VALUE","_prolepticQuarter","quarterValue","isLeapYear","dayOfQuarter","lengthOfQuarter","lengthOfYear","withQuarter","plusQuarters","safeAdd","yearsToAdd","quartersToAdd","quarterCount","calcQuarters","floorMod","yearsToSubtract","MIN_SAFE_INTEGER","minusQuarters","quartersToSubtract","newProlepticQuarter","oldProlepticQuarter","quartersUntil","DAY_OF_QUARTER","leap","atEndOfQuarter","cmp","yearString","yearValue","absYear","abs","concat","DateTimeFormatterBuilder","parseCaseInsensitive","appendValue","SignStyle","EXCEEDS_PAD","appendLiteral","toFormatter","YearWeek","WEEK_BASED_YEAR","WEEK_OF_WEEK_BASED_YEAR","week","verifyInt","_ofYearWeek","_ofWeekBasedYear","weekBasedYear","_weekRange","DayOfWeek","THURSDAY","WEDNESDAY","_week","WEEK_BASED_YEARS","is53WeekYear","withWeek","weeksToAdd","mondayOfWeek","MONDAY","_minusUnit","amountToSubtract","safeSubtract","weeksToSubtract","_daysUntil","_yearsUntil","startDate","endDate","yearsDiff","correction","maxDaysOfYear","daysOfPreviousYear","isInit","init","dayOfMonthInit","dayOfYearInit","intervalInit","localDateRangeInit","offsetDateInit","quarterInit","temporalsInit","yearQuarterInit","yearWeekInit","use","plug"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAUO,SAASA,MAAM,CAACC,SAAS,EAAEC,GAAG,EAAEC,KAAK,EAAE;EAC1C,IAAI,CAACF,SAAS,EAAE;AACZ,IAAA,IAAIE,KAAK,EAAE;AAEP,MAAA,MAAM,IAAIA,KAAK,CAACD,GAAG,CAAC,CAAA;AACxB,KAAC,MAAM;AACH,MAAA,MAAM,IAAIE,KAAK,CAACF,GAAG,CAAC,CAAA;AACxB,KAAA;AACJ,GAAA;AACJ,CAAA;A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AAA,IAAID,MAAM,EAAE;AACR,IAAA,OAAA;AACJ,GAAA;AAEAA,EAAAA,MAAM,GAAG,IAAI,CAAA;AAEbE,EAAAA,OAAc,EAAE,CAAA;AAChBC,EAAAA,OAAa,EAAE,CAAA;AACfC,EAAAA,OAAY,EAAE,CAAA;AACdC,EAAAA,OAAkB,EAAE,CAAA;AACpBC,EAAAA,OAAc,EAAE,CAAA;AAChBC,EAAAA,OAAW,EAAE,CAAA;AACbC,EAAAA,OAAa,EAAE,CAAA;AACfC,EAAAA,OAAe,EAAE,CAAA;AACjBC,EAAAA,KAAY,EAAE,CAAA;AAClB,CAAA;AAEAT,IAAI,EAAE;;ACbS,iBAAwB;;ACtBvC;AACA;AACA;AACA;AAeAU,GAAG,CAACC,IAAI,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"js-joda-extra.esm.js","sources":["../src/assert.js","../src/DayOfMonth.js","../src/DayOfYear.js","../src/Interval.js","../src/LocalDateRange.js","../src/OffsetDate.js","../src/Quarter.js","../src/Temporals.js","../src/YearQuarter.js","../src/YearWeek.js","../src/_init.js","../src/plug.js","../src/js-joda-extra.js"],"sourcesContent":["/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @return {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @return {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, Clock, DateTimeException, IllegalArgumentException, IsoChronology, LocalDate, Month, MonthDay, TemporalAccessor, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A day-of-month in the ISO-8601 calendar system.\n * \n * {@link DayOfMonth} is an immutable date-time object that represents a day-of-month.\n * It is a type-safe way of representing a day-of-month in an application.\n * Any field that can be derived from a day-of-month can be obtained.\n * \n * This class does not store or represent a year, month, time or time-zone.\n * For example, the value '21' can be stored in a {@link DayOfMonth} and\n * would represent the 21st day of any month.\n */\nexport class DayOfMonth extends TemporalAccessor {\n //-----------------------------------------------------------------------\n /**\n * Function overloading for {@link DayOfMonth.now}:\n * - if called with no arguments, {@link DayOfMonth._now0} is executed;\n * - if called with an instance of {@link ZoneId}, then {@link DayOfMonth._nowZoneId} is executed;\n * - if called with an instance of {@link Clock}, then {@link DayOfMonth._nowClock} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {DayOfMonth}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return DayOfMonth._now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return DayOfMonth._nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return DayOfMonth._nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n /**\n * Obtains the current day-of-month from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current day-of-month.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {DayOfMonth} the current day-of-month using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return this.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current day-of-month from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current day-of-month.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {DayOfMonth} the current day-of-month using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return this.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current day-of-month from the specified clock.\n * \n * This will query the specified clock to obtain the current day-of-month.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock dependency injection}.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {DayOfMonth} the current day-of-month, not null\n * @protected\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return DayOfMonth.of(now.dayOfMonth());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfMonth}.\n * \n * A day-of-month object represents one of the 31 days of the month, from 1 to 31.\n *\n * @param {number} dayOfMonth - the day-of-month to represent, from 1 to 31\n * @return {DayOfMonth} the day-of-month, not null\n * @throws {DateTimeException} if the day-of-month is invalid\n */\n static of(dayOfMonth) {\n if (1 <= dayOfMonth && dayOfMonth <= 31) {\n return DayOfMonth.VALUES[dayOfMonth - 1];\n } else {\n throw new DateTimeException(`Invalid value for DayOfMonth: ${dayOfMonth}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfMonth} from a date-time object.\n * \n * This obtains a day-of-month based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link DayOfMonth}.\n * \n * The conversion extracts the {@link ChronoField#DAY_OF_MONTH} day-of-month field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link DayOfMonth.from}.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {DayOfMonth} the day-of-month, not null\n * @throws {DateTimeException} if unable to convert to a {@link DayOfMonth}\n */\n static from(temporal) {\n if (temporal instanceof DayOfMonth) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return DayOfMonth.of(temporal.get(ChronoField.DAY_OF_MONTH));\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain DayOfMonth from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} dayOfMonth the day-of-month to represent, - from 1 to 31.\n * @private\n */\n constructor(dayOfMonth) {\n super();\n this._day = MathUtil.safeToInt(dayOfMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the day-of-month value.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n value() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this day-of-month can be queried for the specified field.\n * If false, then calling the {@link DayOfMonth.range} range,\n * {@link DayOfMonth.get} get and {@link DayOfMonth.getLong} getLong\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * <ul>\n * <li>{@link ChronoField.DAY_OF_MONTH}\n * </ul>\n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this day-of-month, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_MONTH;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-month is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_MONTH) {\n return field.range();\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-month as an `int`.\n * \n * This queries this day-of-month for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported} supported fields will return valid\n * values based on this day-of-month.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-month as a `long`.\n * \n * This queries this day-of-month for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported(TemporalField) supported fields} will return valid\n * values based on this day-of-month.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_MONTH) {\n return this._day;\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year-month is valid for this year.\n * \n * This method checks whether this day and the input year and month form\n * a valid date.\n *\n * @param {YearMonth} yearMonth - the year month to validate, null returns false\n * @return {boolean} true if the year and month are valid for this day\n */\n isValidYearMonth(yearMonth) {\n return yearMonth != null && yearMonth.isValidDay(this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-month using the specified query.\n * \n * This queries this day-of-month using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-month.\n * \n * This returns a temporal object of the same observable type as the input\n * with the day-of-month changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.DAY_OF_MONTH} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisDay.adjustInto(temporal);\n * temporal = temporal.with(thisDay);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }*/\n return temporal.with(ChronoField.DAY_OF_MONTH, this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this day-of-month with a month to create a {@link MonthDay}.\n * \n * This returns a {@link MonthDay} formed from this day and the specified month.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = day.atMonth(month).atYear(year);\n * ```\n * \n * If this day-of-month is invalid for the month then it will be changed\n * to the last valid date for the month.\n *\n * @param {Month | number} month - the month-of-year to use, from 1 (January) to 12 (December), not null\n * @return {MonthDay} the year-month formed from this year and the specified month, not null\n */\n atMonth(month) {\n requireNonNull(month, 'month');\n if (month instanceof Month) {\n return MonthDay.of(month, Math.min(this._day, month.maxLength()));\n } else {\n return MonthDay.of(month, Math.min(this._day, Month.of(month).maxLength()));\n }\n }\n\n /**\n * Combines this day-of-month with a year-month to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this year and the specified year-month.\n * \n * If this day-of-month is invalid for the year-month then it will be changed\n * to the last valid date for the month.\n *\n * @param {YearMonth} yearMonth - the year-month to use, not null\n * @return {LocalDate} the local date formed from this year and the specified year-month, not null\n */\n atYearMonth(yearMonth) {\n requireNonNull(yearMonth, 'yearMonth');\n return yearMonth.atDay(Math.min(this._day, yearMonth.lengthOfMonth()));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this day-of-month to another.\n * \n * The comparison is based on the value of the day.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param {DayOfMonth} other - the other day-of-month instance, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfMonth, 'other');\n return this._day - other._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this day-of-month is equal to another day-of-month.\n *\n * @param {*} obj - the other day-of-month instance, null returns false\n * @return {boolean} true if the day-of-month is the same\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof DayOfMonth) {\n return this._day === obj._day;\n }\n return false;\n }\n\n /**\n * A hash code for this day-of-month.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this day-of-month as a {@link String}.\n *\n * @return {string} a string representation of this day-of-month, not null\n */\n toString() {\n return `DayOfMonth:${this._day}`;\n }\n\n}\n\nexport function _init() {\n /**\n * Cache of singleton instances.\n */\n DayOfMonth.VALUES = new Array(31);\n for (let i = 0; i < 31; i++) {\n DayOfMonth.VALUES[i] = new DayOfMonth(i + 1);\n }\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, Clock, DateTimeException, IllegalArgumentException, IsoChronology, LocalDate, TemporalAccessor, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, Year, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A day-of-year in the ISO-8601 calendar system.\n * \n * {@link DayOfYear} is an immutable date-time object that represents a day-of-year.\n * It is a type-safe way of representing a day-of-year in an application.\n * Any field that can be derived from a day-of-year can be obtained.\n * \n * This class does not store or represent a year, month, time or time-zone.\n * For example, the value \"51\" can be stored in a {@link DayOfYear} and\n * would represent the 51st day of any year.\n */\nexport class DayOfYear extends TemporalAccessor {\n /**\n * Function overloading for {@link DayOfYear.now}:\n * - if called with no arguments, {@link DayOfYear._now0} is executed;\n * - if called with an instance of {@link ZoneId}, then {@link DayOfYear._nowZoneId} is executed;\n * - if called with an instance of {@link Clock}, then {@link DayOfYear._nowClock} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {DayOfYear}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return DayOfYear._now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return DayOfYear._nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return DayOfYear._nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current day-of-year from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current day-of-year.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {DayOfYear} the current day-of-year using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return DayOfYear.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current day-of-year from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current day-of-year.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {DayOfYear} the current day-of-year using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return DayOfYear.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current day-of-year from the specified clock.\n * \n * This will query the specified clock to obtain the current day-of-year.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {DayOfYear} the current day-of-year, not null\n * @protected\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return DayOfYear.of(now.dayOfYear());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfYear}.\n * \n * A day-of-year object represents one of the 366 days of the year, from 1 to 366.\n *\n * @param {number} dayOfYear - the day-of-year to represent, from 1 to 366\n * @return {DayOfYear} the day-of-year, not null\n * @throws {DateTimeException} if the day-of-year is invalid\n */\n static of(dayOfYear) {\n if (1 <= dayOfYear && dayOfYear <= 366) {\n return DayOfYear.VALUES[dayOfYear - 1];\n } else {\n throw new DateTimeException(`Invalid value for DayOfYear: ${dayOfYear}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfYear} from a date-time object.\n * \n * This obtains a day-of-year based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link DayOfYear}.\n * \n * The conversion extracts the {@link ChronoField.DAY_OF_YEAR} day-of-year field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link DayOfYear.from}.\n *\n * @param {Temporal} temporal - the temporal object to convert, not null\n * @return {DayOfYear} the day-of-year, not null\n * @throws {DateTimeException} if unable to convert to a {@link DayOfYear}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof DayOfYear) {\n return temporal;\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return DayOfYear.of(temporal.get(ChronoField.DAY_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain DayOfYear from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n \n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} dayOfYear - the day-of-year being represented, from 1 to 366.\n * @private\n */\n constructor(dayOfYear) {\n super();\n this._day = MathUtil.safeToInt(dayOfYear);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the day-of-year value.\n *\n * @return {number} the day-of-year, from 1 to 366\n */\n value() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this day-of-year can be queried for the specified field.\n * If false, then calling the {@link DayOfYear.range} range,\n * {@link DayOfYear.get} get and {@link DayOfYear.getLong} getLong\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * - {@link ChronoField.DAY_OF_YEAR}\n * \n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this day-of-year, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_YEAR;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-year is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@code ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_YEAR) {\n return field.range();\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-year as an `int`.\n * \n * This queries this day-of-year for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return valid\n * values based on this day-of-year.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-year as a `long`.\n * \n * This queries this day-of-year for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return valid\n * values based on this day-of-year.\n * All other {@code ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_YEAR) {\n return this._day;\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is valid for this day-of-year.\n * \n * This method checks whether this day-of-yearand the input year form\n * a valid date. This can only return false for day-of-year 366.\n *\n * @param {number} year - the year to validate\n * @return {boolean} true if the year is valid for this day-of-year\n */\n isValidYear(year) {\n return (this._day < 366 || Year.isLeap(year));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-year using the specified query.\n * \n * This queries this day-of-year using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-year.\n * \n * This returns a temporal object of the same observable type as the input\n * with the day-of-year changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.DAY_OF_YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisDay.adjustInto(temporal);\n * temporal = temporal.with(thisDay);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException(\"Adjustment only supported on ISO date-time\");\n }*/\n return temporal.with(ChronoField.DAY_OF_YEAR, this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this day-of-year with a year to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this day and the specified year.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = day.atYear(year);\n * ```\n * \n * The day-of-year value 366 is only valid in a leap year.\n *\n * @param {Year|number} year - the year to use ({@link Year} or `int`), not null\n * @return {LocalDate} the local date formed from this day and the specified year, not null\n * @throws {DateTimeException} if the year is invalid or this is day 366 and the year is not a leap year\n */\n atYear(year) {\n requireNonNull(year, 'year');\n if (year instanceof Year) {\n return year.atDay(this._day);\n } else {\n return LocalDate.ofYearDay(year, this._day);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this day-of-year to another.\n * \n * The comparison is based on the value of the day.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {DayOfYear} other - the other day-of-year instance, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfYear, 'other');\n return this._day - other._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this day-of-year is equal to another day-of-year.\n *\n * @param {*} obj - the other day-of-year instance, null returns false\n * @return {boolean} true if the day-of-year is the same\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof DayOfYear) {\n return this._day === obj._day;\n }\n return false;\n }\n\n /**\n * A hash code for this day-of-year.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this day-of-year as a {@link String}.\n *\n * @return {string} a string representation of this day-of-year, not null\n */\n toString() {\n return `DayOfYear:${this._day}`;\n }\n}\n\nexport function _init() {\n /**\n * Cache of singleton instances.\n */\n DayOfYear.VALUES = new Array(366);\n for (let i = 0; i < 366; i++) {\n DayOfYear.VALUES[i] = new DayOfYear(i + 1);\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * \n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * \n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * \n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n * - If called without arguments, then {@link Interval.ofInstantInstant} is executed.\n * - If called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n * - Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {Instant} startInstant\n * @param {Instant|Duration} endInstantOrDuration\n * @return {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of `Interval` from the start and end instant.\n * \n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive - the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive - the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws {DateTimeException} if the end is before the start\n * @protected\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of `Interval` from the start and a duration.\n * \n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive - the start instant, inclusive, not null\n * @param {Duration} duration - the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws {DateTimeException} if the end is before the start,\n * or if the duration addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs when adding the duration\n * @protected\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of `Interval` from a text string such as\n * `2007-12-03T10:15:30Z/2007-12-04T10:15:30Z`, where the end instant is exclusive.\n * \n * The string must consist of one of the following three formats:\n * - a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * - a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * - a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text - the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive - the start instant, inclusive, validated not null\n * @param {Instant} endExclusive - the end instant, exclusive, validated not null\n * @private\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * \n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * \n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * \n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start - the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws {DateTimeException} if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end - the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws {DateTimeException} if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * \n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then `contains(Instant.MIN)` returns true.\n * If this range has an unbounded end then `contains(Instant.MAX)` returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant - the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * \n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other - the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * \n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other - the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * \n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * \n * This is equivalent to `(overlaps(other) || abuts(other))`.\n *\n * @param {Interval} other - the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * \n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * \n * This is equivalent to `(isConnected(other) && !abuts(other))`.\n *\n * @param {Interval} other - the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * \n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other - the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws {DateTimeException} if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * \n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other - the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws {DateTimeException} if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * \n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other - the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Function overloading for {@link Interval#isAfter}\n * - If called with an Instant, then {@link Interval#isAfterInstant} is executed.\n * - Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {Instant|Interval} instantOrInterval\n * @return {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * Function overloading for {@link Interval#isBefore}\n * - If called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n * - Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {Instant|Interval} instantOrInterval\n * @return {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * \n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant - the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * \n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant - the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * \n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval - the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * \n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval - the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * \n * An `Interval` is associated with two specific instants on the time-line.\n * A `Duration` is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws {ArithmeticException} if the calculation exceeds the capacity of `Duration`\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * \n * Compares this `Interval` with another ensuring that the two instants are the same.\n * Only objects of type `Interval` are compared, other types return false.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a `String`, such as `2007-12-03T10:15:30/2007-12-04T10:15:30`.\n * \n * The output will be the ISO-8601 format formed by combining the\n * `toString()` methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ArithmeticException, DateTimeException, DateTimeParseException, IllegalArgumentException, LocalDate, Period } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\n\n/**\n * The day after the MIN date.\n */\nconst MINP1 = LocalDate.MIN.plusDays(1);\n/**\n * The day before the MAX date.\n */\nconst MAXM1 = LocalDate.MAX.minusDays(1);\n\n/**\n * A range of local dates.\n * \n * A `LocalDateRange` represents a range of dates, from a start date to an end date.\n * Instances can be constructed from either a half-open or a closed range of dates.\n * Internally, the class stores the start and end dates, with the start inclusive and the end exclusive.\n * The end date is always greater than or equal to the start date.\n * \n * The constants `LocalDate.MIN` and `LocalDate.MAX` can be used\n * to indicate an unbounded far-past or far-future. Note that there is no difference\n * between a half-open and a closed range when the end is `LocalDate.MAX`.\n * Empty ranges are allowed.\n * \n * No range can end at `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n * No range can start at `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * No empty range can exist at `LocalDate.MIN` or `LocalDate.MAX`.\n * \n * Date ranges are not comparable. To compare the length of two ranges, it is\n * generally recommended to compare the number of days they contain.\n *\n */\nexport class LocalDateRange {\n /**\n * function overloading for {@link LocalDateRange.of}\n * - if called with `LocalDate` and `LocalDate`, {@link LocalDateRange._ofLocalDateLocalDate} is executed,\n * - if called with `LocalDate` and `Period`, {@link LocalDateRange._ofLocalDatePeriod} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @param {LocalDate} startInclusive\n * @param {LocalDate|Period} endExclusiveOrPeriod\n * @return {LocalDateRange}\n */\n static of(startInclusive, endExclusiveOrPeriod) {\n if (startInclusive instanceof LocalDate && endExclusiveOrPeriod instanceof LocalDate) {\n return LocalDateRange._ofLocalDateLocalDate(startInclusive, endExclusiveOrPeriod);\n }\n if (startInclusive instanceof LocalDate && endExclusiveOrPeriod instanceof Period) {\n return LocalDateRange._ofLocalDatePeriod(startInclusive, endExclusiveOrPeriod);\n }\n const messageParts = [];\n if (!(startInclusive instanceof LocalDate)) {\n messageParts.push(`startInclusive must be an instance of LocalDate but is ${startInclusive.constructor.name}`);\n }\n if (!(endExclusiveOrPeriod instanceof LocalDate || endExclusiveOrPeriod instanceof Period)) {\n messageParts.push(`endExclusiveOrPeriod must be an instance of LocalDate or Period but is ${endExclusiveOrPeriod.constructor.name}`);\n }\n throw new IllegalArgumentException(messageParts.join(' and '));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a half-open range of dates, including the start and excluding the end.\n * \n * The range includes the start date and excludes the end date, unless the end is `LocalDate.MAX`.\n * The end date must be equal to or after the start date.\n * This definition permits an empty range located at a specific date.\n * \n * The constants `LocalDate.MIN` and `LocalDate.MAX` can be used\n * to indicate an unbounded far-past or far-future.\n * \n * The start inclusive date must not be `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * The end inclusive date must not be `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n * No empty range can exist at `LocalDate.MIN` or `LocalDate.MAX`.\n *\n * @param {LocalDate} startInclusive - the inclusive start date, not null\n * @param {LocalDate} endExclusive - the exclusive end date, not null\n * @return {LocalDateRange} the half-open range, not null\n * @throws {DateTimeException} if the end is before the start,\n * or the start date is `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`,\n * or the end date is `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`\n * @protected\n */\n static _ofLocalDateLocalDate(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(endExclusive, LocalDate, 'endExclusive');\n return new LocalDateRange(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of `LocalDateRange` from the start and a period.\n * \n * The end date is calculated as the start plus the duration.\n * The period must not be negative.\n * \n * The constant `LocalDate.MIN` can be used to indicate an unbounded far-past.\n * \n * The period must not be zero or one day when the start date is `LocalDate.MIN`.\n *\n * @param {LocalDate} startInclusive - the inclusive start date, not null\n * @param {Period} period - the period from the start to the end, not null\n * @return {LocalDateRange} the range, not null\n * @throws {DateTimeException} if the end is before the start,\n * or if the period addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs when adding the period\n * @protected\n */\n static _ofLocalDatePeriod(startInclusive, period) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(period, 'period');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(period, Period, 'period');\n if (period.isNegative()) {\n throw new DateTimeException('Period must not be zero or negative');\n }\n return new LocalDateRange(startInclusive, startInclusive.plus(period));\n }\n\n /**\n * Obtains a closed range of dates, including the start and end.\n * \n * The range includes the start date and the end date.\n * The end date must be equal to or after the start date.\n * \n * The constants `LocalDate.MIN` and `LocalDate.MAX` can be used\n * to indicate an unbounded far-past or far-future. In addition, an end date of\n * `LocalDate.MAX.minusDays(1)` will also create an unbounded far-future range.\n * \n * The start inclusive date must not be `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * The end inclusive date must not be `LocalDate.MIN`.\n * \n * @param {LocalDate} startInclusive - the inclusive start date, not null\n * @param {LocalDate} endInclusive - the inclusive end date, not null\n * @return {LocalDateRange} the closed range\n * @throws {DateTimeException} if the end is before the start,\n * or the start date is `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`,\n * or the end date is `LocalDate.MIN`\n */\n static ofClosed(startInclusive, endInclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endInclusive, 'endInclusive');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(endInclusive, LocalDate, 'endInclusive');\n if (endInclusive.isBefore(startInclusive)) {\n throw new DateTimeException('Start date must be on or before end date');\n }\n const end = (endInclusive.equals(LocalDate.MAX) ? LocalDate.MAX : endInclusive.plusDays(1));\n return new LocalDateRange(startInclusive, end);\n }\n\n /**\n * Obtains an empty date range located at the specified date.\n * \n * The empty range has zero length and contains no other dates or ranges.\n * An empty range cannot be located at `LocalDate.MIN`, `LocalDate.MIN.plusDays(1)`,\n * `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n *\n * @param {LocalDate} date - the date where the empty range is located, not null\n * @return {LocalDateRange} the empty range, not null\n * @throws {DateTimeException} if the date is `LocalDate.MIN`, `LocalDate.MIN.plusDays(1)`,\n * `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`\n */\n static ofEmpty(date) {\n requireNonNull(date, 'date');\n requireInstance(date, LocalDate, 'date');\n return new LocalDateRange(date, date);\n }\n\n /**\n * Obtains a range that is unbounded at the start and end.\n * \n * @return {LocalDateRange} the range, with an unbounded start and unbounded end\n */\n static ofUnbounded() {\n return LocalDateRange.ALL;\n }\n\n /**\n * Obtains a range up to, but not including, the specified end date.\n * \n * The range includes all dates from the unbounded start, denoted by `LocalDate.MIN`, to the end date.\n * The end date is exclusive and cannot be `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n * \n * @param {LocalDate} endExclusive - the exclusive end date, `LocalDate.MAX` treated as unbounded, not null\n * @return {LocalDateRange} the range, with an unbounded start\n * @throws {DateTimeException} if the end date is `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`\n */\n static ofUnboundedStart(endExclusive) {\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(endExclusive, LocalDate, 'endExclusive');\n return LocalDateRange.of(LocalDate.MIN, endExclusive);\n }\n\n /**\n * Obtains a range from and including the specified start date.\n * \n * The range includes all dates from the start date to the unbounded end, denoted by `LocalDate.MAX`.\n * The start date is inclusive and cannot be `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n * \n * @param {LocalDate} startInclusive - the inclusive start date, `LocalDate.MIN` treated as unbounded, not null\n * @return {LocalDateRange} the range, with an unbounded end\n * @throws {DateTimeException} if the start date is `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`\n */\n static ofUnboundedEnd(startInclusive) {\n return LocalDateRange.of(startInclusive, LocalDate.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `LocalDateRange` from a text string such as\n * `2007-12-03/2007-12-04`, where the end date is exclusive.\n * \n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link LocalDate}, followed by a forward slash,\n * followed by a representation of a {@link LocalDate}\n * <li>a representation of an {@link LocalDate}, followed by a forward slash,\n * followed by a representation of a {@link Period}\n * <li>a representation of a {@link Period}, followed by a forward slash,\n * followed by a representation of an {@link LocalDate}\n * </ul>\n *\n * @param {string} text - the text to parse, not null\n * @return {LocalDateRange} the parsed range, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n for (let i = 0; i < text.length; i++) {\n if (text[i] === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // period followed by date\n const duration = Period.parse(text.slice(0, i));\n const end = LocalDate.parse(text.slice(i + 1, text.length));\n return LocalDateRange.of(end.minus(duration), end);\n } else {\n // date followed by date or period\n const start = LocalDate.parse(text.slice(0, i));\n if (i + 1 < text.length) {\n const c = text[i + 1];\n if (c === 'P' || c === 'p') {\n const duration = Period.parse(text.slice(i + 1, text.length));\n return LocalDateRange.of(start, start.plus(duration));\n }\n }\n const end = LocalDate.parse(text.slice(i + 1, text.length));\n return LocalDateRange.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('LocalDateRange cannot be parsed, no forward slash found', text, 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDate} startInclusive - the start date, inclusive, validated not null\n * @param {LocalDate} endExclusive - the end date, exclusive, validated not null\n * @private\n */\n constructor(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, LocalDate, 'startInclusive');\n requireInstance(endExclusive, LocalDate, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End date must be on or after start date');\n }\n if (startInclusive.equals(MAXM1)) {\n throw new DateTimeException('Range must not start at LocalDate.MAX.minusDays(1)');\n }\n if (endExclusive.equals(MINP1)) {\n throw new DateTimeException('Range must not end at LocalDate.MIN.plusDays(1)');\n }\n if (endExclusive.equals(LocalDate.MIN) || startInclusive.equals(LocalDate.MAX)) {\n throw new DateTimeException('Empty range must not be at LocalDate.MIN or LocalDate.MAX');\n }\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start date of this range, inclusive.\n * \n * This will return `LocalDate#MIN` if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n * \n * This never returns `LocalDate.MAX` or `LocalDate.MAX.minusDays(1)`.\n *\n * @return {LocalDate} the start date\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end date of this range, exclusive.\n * \n * This will return `LocalDate.MAX` if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n * \n * This never returns `LocalDate.MIN` or `LocalDate.MIN.plusDays(1)`.\n *\n * @return {LocalDate} the end date, exclusive\n */\n end() {\n return this._end;\n }\n\n /**\n * Gets the end date of this range, inclusive.\n * \n * This will return `LocalDate.MAX` if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n * \n * This returns the date before the end date.\n * \n * This never returns `LocalDate.MIN`.\n * \n * @return {LocalDate} the end date, inclusive\n */\n endInclusive() {\n if (this.isUnboundedEnd()) {\n return LocalDate.MAX;\n }\n return this._end.minusDays(1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * \n * An empty range occurs when the start date equals the end date.\n * \n * An empty range is never unbounded.\n * \n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the range is unbounded.\n * \n * An unbounded range is never empty.\n * \n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(LocalDate.MIN);\n }\n\n /**\n * Checks if the end of the range is unbounded.\n * \n * An unbounded range is never empty.\n * \n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(LocalDate.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the start date adjusted.\n * \n * This returns a new instance with the start date altered.\n * Since `LocalDate` implements `TemporalAdjuster` any\n * local date can simply be passed in.\n * \n * For example, to adjust the start to one week earlier:\n * <pre>\n * range = range.withStart(date -> date.minus(1, ChronoUnit.WEEKS));\n * </pre>\n * \n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalDateRange} a copy of this range with the start date adjusted\n * @throws {DateTimeException} if the new start date is after the current end date\n */\n withStart(adjuster) {\n return LocalDateRange.of(this._start.with(adjuster), this._end);\n }\n\n /**\n * Returns a copy of this range with the end date adjusted.\n * \n * This returns a new instance with the exclusive end date altered.\n * Since `LocalDate` implements `TemporalAdjuster` any\n * local date can simply be passed in.\n * \n * For example, to adjust the end to one week later:\n * <pre>\n * range = range.withEnd(date -> date.plus(1, ChronoUnit.WEEKS));\n * </pre>\n * \n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalDateRange} a copy of this range with the end date adjusted\n * @throws {DateTimeException} if the new end date is before the current start date\n */\n withEnd(adjuster) {\n return LocalDateRange.of(this._start, this._end.with(adjuster));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range contains the specified date.\n * \n * This checks if the specified date is within the bounds of this range.\n * If this range is empty then this method always returns false.\n * Else if this range has an unbounded start then `contains(LocalDate#MIN)` returns true.\n * Else if this range has an unbounded end then `contains(LocalDate#MAX)` returns true.\n * \n * @param {LocalDate} date - the date to check for, not null\n * @return {boolean} true if this range contains the date\n */\n contains(date) {\n requireNonNull(date, 'date');\n return this._start.compareTo(date) <= 0 && (date.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this range encloses the specified range.\n * \n * This checks if the bounds of the specified range are within the bounds of this range.\n * An empty range encloses itself.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {boolean} true if this range contains all dates in the other range\n */\n encloses(other) {\n requireNonNull(other, 'other');\n return this._start.compareTo(other._start) <= 0 && other._end.compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this range abuts the specified range.\n * \n * The result is true if the end of this range is the start of the other, or vice versa.\n * An empty range does not abut itself.\n *\n * @param {LocalDateRange} other - the other range, not null\n * @return {boolean} true if this range abuts the other range\n */\n abuts(other) {\n requireNonNull(other, 'other');\n return this._end.equals(other._start) !== this._start.equals(other._end);\n }\n\n /**\n * Checks if this range is connected to the specified range.\n * \n * The result is true if the two ranges have an enclosed range in common, even if that range is empty.\n * An empty range is connected to itself.\n * \n * This is equivalent to `(overlaps(other) || abuts(other))`.\n *\n * @param {LocalDateRange} other - the other range, not null\n * @return {boolean} true if this range is connected to the other range\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n return this.equals(other) || (this._start.compareTo(other._end) <= 0 && other._start.compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this range overlaps the specified range.\n * \n * The result is true if the two ranges share some part of the time-line.\n * An empty range overlaps itself.\n * \n * This is equivalent to `(isConnected(other) && !abuts(other))`.\n *\n * @param {LocalDateRange} other - the time range to compare to, null means a zero length range now\n * @return {boolean} true if the time ranges overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n return other.equals(this) || (this._start.compareTo(other._end) < 0 && other._start.compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the range that is the intersection of this range and the specified range.\n * \n * This finds the intersection of two ranges.\n * This throws an exception if the two ranges are not {@linkplain #isConnected(LocalDateRange) connected}.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {LocalDateRange} the range that is the intersection of the two ranges\n * @throws {DateTimeException} if the ranges do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Ranges do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other._start);\n const cmpEnd = this._end.compareTo(other._end);\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other._start);\n const newEnd = (cmpEnd <= 0 ? this._end : other._end);\n return LocalDateRange.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the range that is the union of this range and the specified range.\n * \n * This finds the union of two ranges.\n * This throws an exception if the two ranges are not {@linkplain #isConnected(LocalDateRange) connected}.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {LocalDateRange} the range that is the union of the two ranges\n * @throws {DateTimeException} if the ranges do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Ranges do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other._start);\n const cmpEnd = this._end.compareTo(other._end);\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other._start : this._start);\n const newEnd = (cmpEnd <= 0 ? other._end : this._end);\n return LocalDateRange.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest range that encloses this range and the specified range.\n * \n * The result of this method will {@linkplain #encloses(LocalDateRange) enclose}\n * this range and the specified range.\n * \n * @param {LocalDateRange} other - the other range to check for, not null\n * @return {LocalDateRange} the range that spans the two ranges\n */\n span(other) {\n requireNonNull(other, 'other');\n const cmpStart = this._start.compareTo(other._start);\n const cmpEnd = this._end.compareTo(other._end);\n const newStart = (cmpStart >= 0 ? other._start : this._start);\n const newEnd = (cmpEnd <= 0 ? other._end : this._end);\n return LocalDateRange.of(newStart, newEnd);\n }\n\n /**\n * Function overloading for {@link LocalDateRange.isAfter}\n * - if called with `LocalDate`, {@link LocalDateRange._isAfterLocalDate} is executed,\n * - if called with `LocalDateRange`, {@link LocalDateRange._isAfterLocalDateRange} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @param {LocalDate|LocalDateRange} localDateOrLocalDateRange\n * @return {boolean}\n */\n isAfter(localDateOrLocalDateRange) {\n if (localDateOrLocalDateRange instanceof LocalDate) {\n return this._isAfterLocalDate(localDateOrLocalDateRange);\n }\n if (localDateOrLocalDateRange instanceof LocalDateRange) {\n return this._isAfterLocalDateRange(localDateOrLocalDateRange);\n }\n throw new IllegalArgumentException(`localDateOrLocalDateRange must be an instance of LocalDate or LocalDateRange but is ${localDateOrLocalDateRange.constructor.name}`);\n }\n\n /**\n * Function overloading for {@link LocalDateRange.isBefore}\n * - if called with `LocalDate`, {@link LocalDateRange._isBeforeLocalDate} is executed,\n * - if called with `LocalDateRange`, {@link LocalDateRange._isBeforeLocalDateRange} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @param {LocalDate|LocalDateRange} localDateOrLocalDateRange\n * @return {boolean}\n */\n isBefore(localDateOrLocalDateRange) {\n if (localDateOrLocalDateRange instanceof LocalDate) {\n return this._isBeforeLocalDate(localDateOrLocalDateRange);\n }\n if (localDateOrLocalDateRange instanceof LocalDateRange) {\n return this._isBeforeLocalDateRange(localDateOrLocalDateRange);\n }\n throw new IllegalArgumentException(`localDateOrLocalDateRange must be an instance of LocalDate or LocalDateRange but is ${localDateOrLocalDateRange.constructor.name}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range is after the specified date.\n * \n * The result is true if every date in this range is after the specified date.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDate} date - the other date to compare to, not null\n * @return {boolean} true if the start of this range is after the specified date\n * @protected\n */\n _isAfterLocalDate(date) {\n return this._start.compareTo(date) > 0;\n }\n\n /**\n * Checks if this range is before the specified date.\n * \n * The result is true if every date in this range is before the specified date.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDate} date - the other date to compare to, not null\n * @return {boolean} true if the start of this range is before the specified date\n * @protected\n */\n _isBeforeLocalDate(date) {\n return this._end.compareTo(date) <= 0 && this._start.compareTo(date) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range is after the specified range.\n * \n * The result is true if every date in this range is after every date in the specified range.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDateRange} other - the other range to compare to, not null\n * @return {boolean} true if every date in this range is after every date in the other range\n * @protected\n */\n _isAfterLocalDateRange(other) {\n return this._start.compareTo(other._end) >= 0 && !other.equals(this);\n }\n\n /**\n * Checks if this range is before the specified range.\n * \n * The result is true if every date in this range is before every date in the specified range.\n * An empty range behaves as though it is a date for comparison purposes.\n *\n * @param {LocalDateRange} range - the other range to compare to, not null\n * @return {boolean} true if every date in this range is before every date in the other range\n * @protected\n */\n _isBeforeLocalDateRange(range) {\n return this._end.compareTo(range._start) <= 0 && !range.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the length of this range in days.\n * \n * This returns the number of days between the start and end dates.\n * Unbounded ranges return `Number.POSITIVE_INFINITY`.\n *\n * @return {number} the length in days, `Number.POSITIVE_INFINITY` if unbounded\n */\n lengthInDays() {\n if (this.isUnboundedStart() || this.isUnboundedEnd()) {\n return Number.POSITIVE_INFINITY;\n }\n return this._end.toEpochDay() - this._start.toEpochDay();\n }\n\n /**\n * Obtains the length of this range as a period.\n * \n * This returns the {@link Period} between the start and end dates.\n * Unbounded ranges throw {@link ArithmeticException}.\n *\n * @return {Period} the period of the range\n * @throws {ArithmeticException} if the calculation exceeds the capacity of `Period`,\n * or the range is unbounded\n */\n toPeriod() {\n if (this.isUnboundedStart() || this.isUnboundedEnd()) {\n throw new ArithmeticException('Unbounded range cannot be converted to a Period');\n }\n return Period.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this range is equal to another range.\n * \n * Compares this `LocalDateRange` with another ensuring that the two dates are the same.\n * Only objects of type `LocalDateRange` are compared, other types return false.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other range\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof LocalDateRange) {\n const other = obj;\n return this._start.equals(other._start) && this._end.equals(other._end);\n }\n return false;\n }\n\n /**\n * A hash code for this range.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this range as a `String`, such as `2007-12-03/2007-12-04`.\n * \n * The output will be the ISO-8601 format formed by combining the\n * `toString()` methods of the two dates, separated by a forward slash.\n *\n * @return {string} a string representation of this date, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n /**\n * A range over the whole time-line.\n */\n LocalDateRange.ALL = new LocalDateRange(LocalDate.MIN, LocalDate.MAX);\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, ChronoUnit, Clock, DateTimeException, DateTimeFormatter, IllegalArgumentException, IsoChronology, LocalDate, OffsetDateTime, Temporal, TemporalField, TemporalQueries, TemporalQuery, TemporalUnit, ZoneId, ZoneOffset } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * The number of seconds per day.\n */\nconst SECONDS_PER_DAY = 86400;\n\n/**\n * A date with an offset from UTC/Greenwich in the ISO-8601 calendar system,\n * such as `2007-12-03+01:00`.\n * \n * `OffsetDate` is an immutable date-time object that represents a date, often viewed\n * as year-month-day-offset. This object can also access other date fields such as\n * day-of-year, day-of-week and week-of-year.\n * \n * This class does not store or represent a time.\n * For example, the value '2nd October 2007 +02:00' can be stored\n * in an `OffsetDate`.\n *\n */\nexport class OffsetDate extends Temporal {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link OffsetDate.now}\n * - if called with 0 argument {@link OffsetDate._now0} is executed,\n * - if called with 1 argument and first argument is an instance of ZoneId, then {@link OffsetDate._nowZoneId} is executed,\n * - otherwise {@link OffsetDate._nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {YearQuarter}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return OffsetDate._now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return OffsetDate._nowZoneId(zoneIdOrClock);\n } else {\n return OffsetDate._nowClock(zoneIdOrClock);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current date from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current date.\n * The offset will be calculated from the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {OffsetDate} the current date using the system clock, not null\n * @protected\n */\n static _now0() {\n return OffsetDate.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current date from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current date.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * The offset will be calculated from the specified time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {OffsetDate} the current date using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return OffsetDate.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current date from the specified clock.\n * \n * This will query the specified clock to obtain the current date - today.\n * The offset will be calculated from the time-zone in the clock.\n * \n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {OffsetDate} the current date, not null\n * @protected\n */\n static _nowClock(clock) {\n requireNonNull(clock, 'clock');\n const now = clock.instant(); // called once\n return OffsetDate.ofInstant(now, clock.zone().rules().offset(now));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link OffsetDate.of}\n * - if called with 2 arguments {@link OffsetDate._ofLocalDateZoneOffset} is executed,\n * - if called with 4 agruments {@link OffsetDate._ofIntIntIntZoneOffset} is executed,\n * - otherwise throws IllegalArgumentException.\n *\n * @return {YearQuarter}\n */\n static of() {\n switch (arguments.length) {\n case 2: return OffsetDate._ofLocalDateZoneOffset(...arguments);\n case 4: return OffsetDate._ofIntIntIntZoneOffset(...arguments);\n default: throw new IllegalArgumentException('Illegal number of arguments');\n }\n }\n\n /**\n * Obtains an instance of `OffsetDate` from a local date and an offset.\n *\n * @param {LocalDate} date - the local date, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @return {OffsetDate} the offset date, not null\n * @protected\n */\n static _ofLocalDateZoneOffset(date, offset) {\n return new OffsetDate(date, offset);\n }\n\n /**\n * Obtains an instance of `OffsetDate` from a year, month, day\n * and offset.\n * \n * This creates an offset date with the four specified fields.\n * \n * This method exists primarily for writing test cases.\n * Non test-code will typically use other methods to create an offset time.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} month - the month-of-year to represent, from 1 (January) to 12 (December)\n * @param {number} dayOfMonth - the day-of-month to represent, from 1 to 31\n * @param {ZoneOffset} offset - the zone offset, not null\n * @return {OffsetDate} the offset date, not null\n * @throws {DateTimeException} if the value of any field is out of range, or\n * if the day-of-month is invalid for the month-year\n * @protected\n */\n static _ofIntIntIntZoneOffset(year, month, dayOfMonth, offset) {\n const d = LocalDate.of(year, month, dayOfMonth);\n return new OffsetDate(d, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `OffsetDate` from an `Instant` and zone ID.\n * \n * This creates an offset date with the same instant as midnight at the\n * start of day of the instant specified.\n * Finding the offset from UTC/Greenwich is simple as there is only one valid\n * offset for each instant.\n *\n * @param {Instant} instant - the instant to create the time from, not null\n * @param {ZoneId} zone - the time-zone, which may be an offset, not null\n * @return {OffsetDate} the offset time, not null\n */\n static ofInstant(instant, zone) {\n requireNonNull(instant, 'instant');\n requireNonNull(zone, 'zone');\n const rules = zone.rules();\n const offset = rules.offset(instant);\n const epochSec = instant.epochSecond() + offset.totalSeconds(); // overflow caught later\n const epochDay = MathUtil.floorDiv(epochSec, SECONDS_PER_DAY);\n const date = LocalDate.ofEpochDay(epochDay);\n return new OffsetDate(date, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `OffsetDate` from a temporal object.\n * \n * A `TemporalAccessor` represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of `OffsetDate`.\n * \n * The conversion extracts and combines `LocalDate` and `ZoneOffset`.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, `OffsetDate.FROM`.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {OffsetDate} the offset date, not null\n * @throws {DateTimeException} if unable to convert to an `OffsetDate`\n */\n static from(temporal) {\n if (temporal instanceof OffsetDate) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n const date = LocalDate.from(temporal);\n const offset = ZoneOffset.from(temporal);\n return new OffsetDate(date, offset);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain OffsetDate from TemporalAccessor: ${temporal.constructor.name}`, ex);\n }\n }\n\n /**\n * Obtains an instance of `OffsetDate` from a text string using a specific formatter.\n * \n * The text is parsed using the formatter, returning a date.\n *\n * @param {CharSequence} text - the text to parse, not null\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {OffsetDate} the parsed offset date, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_OFFSET_DATE) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, OffsetDate.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDate} date - the local date, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @private\n */\n constructor(date, offset) {\n super();\n this._date = requireNonNull(date, 'date');\n this._offset = requireNonNull(offset, 'offset');\n }\n\n /**\n * Returns a new date based on this one, returning `this` where possible.\n *\n * @param {LocalDate} date - the date to create with, not null\n * @param {ZoneOffset} offset - the zone offset to create with, not null\n * @private\n */\n _with(date, offset) {\n if (this._date === date && this._offset.equals(offset)) {\n return this;\n }\n return new OffsetDate(date, offset);\n }\n\n /**\n * function overloading for {@link OffsetDate.isSupported}\n * - if called with an instance of {@link TemporalField}, then {@link OffsetDate._isSupportedField} is executed,\n * - if called with an instance of {@link TemporalUnit}, then {@link OffsetDate._isSupportedUnit} is executed,\n * - otherwise {@link IllegalArgumentException} is thrown.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit\n * @return {boolean}\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof TemporalField) {\n return this._isSupportedField(fieldOrUnit);\n }\n if (fieldOrUnit instanceof TemporalUnit) {\n return this._isSupportedUnit(fieldOrUnit);\n }\n if (fieldOrUnit == null) {\n return false;\n }\n throw new IllegalArgumentException(`fieldOrUnit must be an instance of TemporalField or TemporalUnit, but is ${fieldOrUnit.constructor.name}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this date can be queried for the specified field.\n * If false, then calling the {@link OffsetDate.range},\n * {@link OffsetDate.get} and {@link OffsetDate.with}\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * \n * - `DAY_OF_WEEK`\n * - `ALIGNED_DAY_OF_WEEK_IN_MONTH`\n * - `ALIGNED_DAY_OF_WEEK_IN_YEAR`\n * - `DAY_OF_MONTH`\n * - `DAY_OF_YEAR`\n * - `EPOCH_DAY`\n * - `ALIGNED_WEEK_OF_MONTH`\n * - `ALIGNED_WEEK_OF_YEAR`\n * - `MONTH_OF_YEAR`\n * - `PROLEPTIC_MONTH`\n * - `YEAR_OF_ERA`\n * - `YEAR`\n * - `ERA`\n * - `OFFSET_SECONDS`\n * \n * All other `ChronoField` instances will return false.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this date, false if not\n * @protected\n */\n _isSupportedField(field) {\n if (field instanceof ChronoField) {\n return field.isDateBased() || field === ChronoField.OFFSET_SECONDS;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n * \n * This checks if the specified unit can be added to, or subtracted from, this date.\n * If false, then calling the {@link OffsetDate.plus(long, TemporalUnit)} and\n * {@link OffsetDate.minus(long, TemporalUnit) minus} methods will throw an exception.\n * \n * If the unit is a {@link ChronoUnit} then the query is implemented here.\n * The supported units are:\n * <ul>\n * - `DAYS`\n * - `WEEKS`\n * - `MONTHS`\n * - `YEARS`\n * - `DECADES`\n * - `CENTURIES`\n * - `MILLENNIA`\n * - `ERAS`\n * </ul>\n * All other `ChronoUnit` instances will return false.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.isSupportedBy(Temporal)`\n * passing `this` as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if the unit can be added/subtracted, false if not\n * @protected\n */\n _isSupportedUnit(unit) {\n if (unit instanceof ChronoUnit) {\n return unit.isDateBased();\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This date is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OffsetDate.isSupported} supported fields will return\n * appropriate range instances.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return field.range();\n }\n return this._date.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this date as an `int`.\n * \n * This queries this date for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OffsetDate.isSupported} supported fields will return valid\n * values based on this date, except `EPOCH_DAY` and `PROLEPTIC_MONTH`\n * which are too large to fit in an `int` and throw a `DateTimeException`.\n * All other `ChronoField` instances will throw a `DateTimeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this date as a `long`.\n * \n * This queries this date for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link OffsetDate.isSupported} supported fields will return valid\n * values based on this date.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return this.offset().totalSeconds();\n }\n return this._date.getLong(field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the zone offset, such as '+01:00'.\n * \n * This is the offset of the local date from UTC/Greenwich.\n *\n * @return {ZoneOffset} the zone offset, not null\n */\n offset() {\n return this._offset;\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified offset ensuring\n * that the result has the same local date.\n * \n * This method returns an object with the same `LocalDate` and the specified `ZoneOffset`.\n * No calculation is needed or performed.\n * For example, if this time represents `2007-12-03+02:00` and the offset specified is\n * `+03:00`, then this method will return `2007-12-03+03:00`.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {ZoneOffset} offset - the zone offset to change to, not null\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested offset, not null\n */\n withOffsetSameLocal(offset) {\n requireNonNull(offset, 'offset');\n return this._with(this._date, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the `LocalDate` part of this date.\n * \n * This returns a `LocalDate` with the same year, month and day\n * as this date.\n *\n * @return {LocalDate} the date part of this date, not null\n */\n toLocalDate() {\n return this._date;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n * \n * This method returns the primitive `int` value for the year.\n * \n * The year returned by this method is proleptic as per `get(YEAR)`.\n * To obtain the year-of-era, use `get(YEAR_OF_ERA)`.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._date.year();\n }\n\n /**\n * Gets the month-of-year field from 1 to 12.\n * \n * This method returns the month as an `int` from 1 to 12.\n * Application code is frequently clearer if the enum {@link Month}\n * is used by calling {@link OffsetDate.month}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see OffsetDate.month()\n */\n monthValue() {\n return this._date.monthValue();\n }\n\n /**\n * Gets the month-of-year field using the `Month` enum.\n * \n * This method returns the enum {@link Month} for the month.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link Month.value} int value.\n *\n * @return {Month} the month-of-year, not null\n * @see OffsetDate.monthValue()\n */\n month() {\n return this._date.month();\n }\n\n /**\n * Gets the day-of-month field.\n * \n * This method returns the primitive `int` value for the day-of-month.\n *\n * @return {number} the day-of-month, from 1 to 31\n */\n dayOfMonth() {\n return this._date.dayOfMonth();\n }\n\n /**\n * Gets the day-of-year field.\n * \n * This method returns the primitive `int` value for the day-of-year.\n *\n * @return {number} the day-of-year, from 1 to 365, or 366 in a leap year\n */\n dayOfYear() {\n return this._date.dayOfYear();\n }\n\n /**\n * Gets the day-of-week field, which is an enum `DayOfWeek`.\n * \n * This method returns the enum {@link DayOfWeek} for the day-of-week.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link DayOfWeek.value} int value.\n * \n * Additional information can be obtained from the `DayOfWeek`.\n * This includes textual names of the values.\n *\n * @return {DayOfWeek} the day-of-week, not null\n */\n dayOfWeek() {\n return this._date.dayOfWeek();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this date.\n * \n * This returns an `OffsetDate` based on this one, with the date adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n * \n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the date to the last day of the month.\n * A selection of common adjustments is provided in {@link TemporalAdjusters}.\n * These include finding the 'last day of the month' and 'next Wednesday'.\n * Key date-time classes also implement the `TemporalAdjuster` interface,\n * such as {@link Month} and {@link MonthDay}.\n * The adjuster is responsible for handling special cases, such as the varying\n * lengths of month and leap years.\n * \n * For example this code returns a date on the last day of July:\n * <pre>\n * import static java.time.Month.*;\n * import static java.time.temporal.TemporalAdjusters.*;\n *\n * result = offsetDate.with(JULY).with(lastDayOfMonth());\n * </pre>\n * \n * The classes {@link LocalDate} and {@link ZoneOffset} implement `TemporalAdjuster`,\n * thus this method can be used to change the date or offset:\n * <pre>\n * result = offsetDate.with(date);\n * result = offsetDate.with(offset);\n * </pre>\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster.adjustInto} method on the\n * specified adjuster passing `this` as the argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {OffsetDate} an `OffsetDate` based on `this` with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof LocalDate) {\n return this._with(adjuster, this._offset);\n } else if (adjuster instanceof ZoneOffset) {\n return this._with(this._date, adjuster);\n } else if (adjuster instanceof OffsetDate) {\n return adjuster;\n }\n return super._withAdjuster(adjuster);\n }\n\n /**\n * Returns a copy of this date with the specified field set to a new value.\n * \n * This returns an `OffsetDate` based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year, month or day-of-month.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n * \n * In some cases, changing the specified field can cause the resulting date to become invalid,\n * such as changing the month from 31st January to February would make the day-of-month invalid.\n * In cases like this, the field is responsible for resolving the date. Typically it will choose\n * the previous valid date, which would be the last valid day of February in this example.\n * \n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * \n * The `OFFSET_SECONDS` field will return a date with the specified offset.\n * The local date is unaltered. If the new offset value is outside the valid range\n * then a `DateTimeException` will be thrown.\n * \n * The other {@link OffsetDate.isSupported} supported fields will behave as per\n * the matching method on {@link LocalDate.with} LocalDate.\n * In this case, the offset is not part of the calculation and will be unchanged.\n * \n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.adjustInto(Temporal, long)`\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {OffsetDate} an `OffsetDate` based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withField(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n if (field === ChronoField.OFFSET_SECONDS) {\n const f = field;\n return this._with(this._date, ZoneOffset.ofTotalSeconds(f.checkValidIntValue(newValue)));\n }\n return this._with(this._date.with(field, newValue), this._offset);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `OffsetDate` with the year altered.\n * \n * The offset does not affect the calculation and will be the same in the result.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {OffsetDate} year - the year to set in the result, from MIN_YEAR to MAX_YEAR\n * @return {number} an `OffsetDate` based on this date with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n return this._with(this._date.withYear(year), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the month-of-year altered.\n * \n * The offset does not affect the calculation and will be the same in the result.\n * If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested month, not null\n * @throws {DateTimeException} if the month-of-year value is invalid\n */\n withMonth(month) {\n return this._with(this._date.withMonth(month), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the day-of-month altered.\n * \n * If the resulting date is invalid, an exception is thrown.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfMonth - the day-of-month to set in the result, from 1 to 28-31\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-month value is invalid,\n * or if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n return this._with(this._date.withDayOfMonth(dayOfMonth), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the day-of-year altered.\n * \n * If the resulting date is invalid, an exception is thrown.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} dayOfYear - the day-of-year to set in the result, from 1 to 365-366\n * @return {OffsetDate} an `OffsetDate` based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-year value is invalid,\n * or if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n return this._with(this._date.withDayOfYear(dayOfYear), this._offset);\n }\n\n /**\n * Returns a copy of this date with the specified amount added.\n * \n * This returns an `OffsetDate` based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoUnit} then the addition is implemented by\n * {@link LocalDate.plus}.\n * The offset is not part of the calculation and will be unchanged in the result.\n * \n * If the field is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.addTo(Temporal, long)`\n * passing `this` as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to add, not null\n * @return {OffsetDate} an `OffsetDate` based on this date with the specified amount added, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _plusUnit(amountToAdd, unit) {\n if (unit instanceof ChronoUnit) {\n return this._with(this._date.plus(amountToAdd, unit), this._offset);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `OffsetDate` with the specified number of years added.\n * \n * This uses {@link LocalDate.plusYears} to add the years.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusYears(years) {\n return this._with(this._date.plusYears(years), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of months added.\n * \n * This uses {@link LocalDate.plusMonths} to add the months.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the months added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMonths(months) {\n return this._with(this._date.plusMonths(months), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of weeks added.\n * \n * This uses {@link LocalDate.plusWeeks} to add the weeks.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the weeks added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusWeeks(weeks) {\n return this._with(this._date.plusWeeks(weeks), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of days added.\n * \n * This uses {@link LocalDate.plusDays)} to add the days.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to add, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the days added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusDays(days) {\n return this._with(this._date.plusDays(days), this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `OffsetDate` with the specified number of years subtracted.\n * \n * This uses {@link LocalDate.minusYears} to subtract the years.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} years - the years to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusYears(years) {\n return this._with(this._date.minusYears(years), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of months subtracted.\n * \n * This uses {@link LocalDate.minusMonths} to subtract the months.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the months subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMonths(months) {\n return this._with(this._date.minusMonths(months), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of weeks subtracted.\n * \n * This uses {@link LocalDate.minusWeeks} to subtract the weeks.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weeks - the weeks to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the weeks subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusWeeks(weeks) {\n return this._with(this._date.minusWeeks(weeks), this._offset);\n }\n\n /**\n * Returns a copy of this `OffsetDate` with the specified number of days subtracted.\n * \n * This uses {@link LocalDate.minusDays} to subtract the days.\n * The offset does not affect the calculation and will be the same in the result.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to subtract, may be negative\n * @return {OffsetDate} an `OffsetDate` based on this date with the days subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusDays(days) {\n return this._with(this._date.minusDays(days), this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this date using the specified query.\n * \n * This queries this date using the specified query strategy object.\n * The `TemporalQuery` object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.DAYS;\n } else if (query === TemporalQueries.offset() || query === TemporalQueries.zone()) {\n return this.offset();\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have the same offset and date\n * as this object.\n * \n * This returns a temporal object of the same observable type as the input\n * with the offset and date changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * twice, passing {@link ChronoField.OFFSET_SECONDS} and\n * {@link ChronoField.EPOCH_DAY} as the fields.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with(TemporalAdjuster)}:\n * <pre>\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisOffsetDate.adjustInto(temporal);\n * temporal = temporal.with(thisOffsetDate);\n * </pre>\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal\n .with(ChronoField.OFFSET_SECONDS, this.offset().totalSeconds())\n .with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay());\n }\n\n /**\n * Calculates the period between this date and another date in\n * terms of the specified unit.\n * \n * This calculates the period between two dates in terms of a single unit.\n * The start and end points are `this` and the specified date.\n * The result will be negative if the end is before the start.\n * For example, the period in days between two dates can be calculated\n * using `startDate.until(endDate, DAYS)`.\n * \n * The `Temporal` passed to this method is converted to a\n * `OffsetDate` using {@link OffsetDate.from}.\n * If the offset differs between the two times, then the specified\n * end time is normalized to have the same offset as this time.\n * \n * The calculation returns a whole number, representing the number of\n * complete units between the two dates.\n * For example, the period in months between 2012-06-15Z and 2012-08-14Z\n * will only be one month as it is one day short of two months.\n * \n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit.between}:\n * <pre>\n * // these two lines are equivalent\n * amount = start.until(end, DAYS);\n * amount = DAYS.between(start, end);\n * </pre>\n * The choice should be made based on which makes the code more readable.\n * \n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units `DAYS`, `WEEKS`, `MONTHS`, `YEARS`,\n * `DECADES`, `CENTURIES`, `MILLENNIA` and `ERAS`\n * are supported. Other `ChronoUnit` values will throw an exception.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.between(Temporal, Temporal)`\n * passing `this` as the first argument and the converted input temporal\n * as the second argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end time, exclusive, which is converted to an `OffsetDate`, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this date and the end date\n * @throws {DateTimeException} if the amount cannot be calculated, or the end\n * temporal cannot be converted to an `OffsetDate`\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n const end = OffsetDate.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const offsetDiff = end._offset.totalSeconds() - this._offset.totalSeconds();\n const endLocal = end._date.plusDays(MathUtil.intDiv(-offsetDiff, SECONDS_PER_DAY));\n return this._date.until(endLocal, unit);\n }\n return unit.between(this, end);\n }\n\n /**\n * Formats this date using the specified formatter.\n * \n * This date will be passed to the formatter to produce a string.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted date string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an offset date-time formed from this date at the specified time.\n * \n * This combines this date with the specified time to form an `OffsetDateTime`.\n * All possible combinations of date and time are valid.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {LocalTime} time - the time to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this date and the specified time, not null\n */\n atTime(time) {\n return OffsetDateTime.of(this._date, time, this._offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Converts this date to midnight at the start of day in epoch seconds.\n *\n * @return {number} the epoch seconds value\n * @private\n */\n _toEpochSecond() {\n const epochDay = this._date.toEpochDay();\n const secs = epochDay * SECONDS_PER_DAY;\n return secs - this._offset.totalSeconds();\n }\n\n /**\n * Converts this `OffsetDate` to the number of seconds since the epoch\n * of 1970-01-01T00:00:00Z.\n * \n * This combines this offset date with the specified time\n * to calculate the epoch-second value, which is the\n * number of elapsed seconds from 1970-01-01T00:00:00Z.\n * Instants on the time-line after the epoch are positive, earlier\n * are negative.\n *\n * @param {LocalTime} time - the local time, not null\n * @return {number} the number of seconds since the epoch of 1970-01-01T00:00:00Z, may be negative\n */\n toEpochSecond(time) {\n requireNonNull(time, 'time');\n return this._toEpochSecond() + time.toSecondOfDay();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this `OffsetDate` to another date.\n * \n * The comparison is based first on the UTC equivalent instant, then on the local date.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n * \n * For example, the following is the comparator order:\n * 1. 2008-06-29-11:00</li>\n * 2. 2008-06-29-12:00</li>\n * 3. 2008-06-30+12:00</li>\n * 4. 2008-06-29-13:00</li>\n * \n * Values #2 and #3 represent the same instant on the time-line.\n * When two values represent the same instant, the local date is compared\n * to distinguish them. This step is needed to make the ordering\n * consistent with `equals()`.\n * \n * To compare the underlying local date of two `TemporalAccessor` instances,\n * use {@link ChronoField.EPOCH_DAY} as a comparator.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n if (this._offset.equals(other._offset)) {\n return this._date.compareTo(other._date);\n }\n let compare = this._toEpochSecond() - other._toEpochSecond();\n if (compare === 0) {\n compare = this._date.compareTo(other._date);\n }\n return compare;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the instant of midnight at the start of this `OffsetDate`\n * is after midnight at the start of the specified date.\n * \n * This method differs from the comparison in {@link OffsetDate.compareTo} in that it\n * only compares the instant of the date. This is equivalent to using\n * `date1.toEpochSecond().isAfter(date2.toEpochSecond())`.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {boolean} true if this is after the instant of the specified date\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n return this._toEpochSecond() > other._toEpochSecond();\n }\n\n /**\n * Checks if the instant of midnight at the start of this `OffsetDate`\n * is before midnight at the start of the specified date.\n * \n * This method differs from the comparison in {@link OffsetDate.compareTo} in that it\n * only compares the instant of the date. This is equivalent to using\n * `date1.toEpochSecond().isBefore(date2.toEpochSecond())`.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {boolean} true if this is before the instant of the specified date\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n return this._toEpochSecond() < other._toEpochSecond();\n }\n\n /**\n * Checks if the instant of midnight at the start of this `OffsetDate`\n * equals midnight at the start of the specified date.\n * \n * This method differs from the comparison in {@link OffsetDate.compareTo} and {@link OffsetDate.equals}\n * in that it only compares the instant of the date. This is equivalent to using\n * `date1.toEpochSecond().equals(date2.toEpochSecond())`.\n *\n * @param {OffsetDate} other - the other date to compare to, not null\n * @return {boolean} true if the instant equals the instant of the specified date\n */\n isEqual(other) {\n requireNonNull(other, 'other');\n requireInstance(other, OffsetDate, 'other');\n return this._toEpochSecond() === other._toEpochSecond();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date is equal to another date.\n * \n * The comparison is based on the local-date and the offset.\n * To compare for the same instant on the time-line, use {@link OffsetDate.isEqual}.\n * \n * Only objects of type `OffsetDate` are compared, other types return false.\n * To compare the underlying local date of two `TemporalAccessor` instances,\n * use {@link ChronoField.EPOCH_DAY} as a comparator.\n *\n * @param {Object} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other date\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof OffsetDate) {\n const other = obj;\n return this._date.equals(other._date) && this._offset.equals(other._offset);\n }\n return false;\n }\n\n /**\n * A hash code for this date.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._date.hashCode() ^ this._offset.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this date as a `String`, such as `2007-12-03+01:00`.\n * \n * The output will be in the ISO-8601 format `yyyy-MM-ddXXXXX`.\n *\n * @return {String} a string representation of this date, not null\n */\n toString() {\n return this._date.toString() + this._offset.toString();\n }\n}\n\nexport function _init() {\n /**\n * The minimum supported `OffsetDate`, '-999999999-01-01+18:00'.\n * This is the minimum local date in the maximum offset\n * (larger offsets are earlier on the time-line).\n * This combines {@link LocalDate.MIN} and {@link ZoneOffset.MAX}.\n * This could be used by an application as a 'far past' date.\n */\n OffsetDate.MIN = OffsetDate.of(LocalDate.MIN, ZoneOffset.MAX);\n /**\n * The maximum supported `OffsetDate`, '+999999999-12-31-18:00'.\n * This is the maximum local date in the minimum offset\n * (larger negative offsets are later on the time-line).\n * This combines {@link LocalDate.MAX} and {@link ZoneOffset.MIN}.\n * This could be used by an application as a 'far future' date.\n */\n OffsetDate.MAX = OffsetDate.of(LocalDate.MAX, ZoneOffset.MIN);\n\n OffsetDate.FROM = createTemporalQuery('OffsetDate.FROM', (temporal) => {\n return OffsetDate.from(temporal);\n });\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\nimport { ChronoField, DateTimeException, IllegalArgumentException, IllegalStateException, IsoChronology, IsoFields, Month, TemporalAccessor, TemporalField, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A quarter-of-year, such as 'Q2'.\n *\n * `Quarter` is an enum representing the 4 quarters of the year -\n * Q1, Q2, Q3 and Q4. These are defined as January to March, April to June,\n * July to September and October to December.\n *\n * The `int` value follows the quarter, from 1 (Q1) to 4 (Q4).\n * It is recommended that applications use the enum rather than the `int` value\n * to ensure code clarity.\n *\n * **Do not use `ordinal()` to obtain the numeric representation of `Quarter`.\n * Use `getValue()` instead.**\n *\n * This enum represents a common concept that is found in many calendar systems.\n * As such, this enum may be used by any calendar system that has the quarter-of-year\n * concept defined exactly equivalent to the ISO calendar system.\n *\n */\nexport class Quarter extends TemporalAccessor {\n /**\n * replacement for enum `valueOf(name)`\n *\n * @param {string} name\n * @return {Quarter}\n */\n static valueOf(name) {\n requireNonNull(name, 'name');\n switch (name) {\n case 'Q1':\n return Quarter.Q1;\n case 'Q2':\n return Quarter.Q2;\n case 'Q3':\n return Quarter.Q3;\n case 'Q4':\n return Quarter.Q4;\n }\n throw new IllegalArgumentException(`No enum constant Quarter.${name}`);\n }\n\n /**\n * replacement for enum `values()`\n * @return {Quarter[]}\n */\n static values() {\n return QUARTERS.slice();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `Quarter` from an `int` value.\n *\n * `Quarter` is an enum representing the 4 quarters of the year.\n * This factory allows the enum to be obtained from the `int` value.\n * The `int` value follows the quarter, from 1 (Q1) to 4 (Q4).\n *\n * @param {number} quarterOfYear - the quarter-of-year to represent, from 1 (Q1) to 4 (Q4)\n * @return {Quarter} the quarter-of-year, not null\n * @throws {DateTimeException} if the quarter-of-year is invalid\n */\n static of(quarterOfYear) {\n requireNonNull(quarterOfYear, 'quarterOfYear');\n switch (quarterOfYear) {\n case 1:\n return Quarter.Q1;\n case 2:\n return Quarter.Q2;\n case 3:\n return Quarter.Q3;\n case 4:\n return Quarter.Q4;\n default:\n throw new DateTimeException(`Invalid value for Quarter: ${quarterOfYear}`);\n }\n }\n\n /**\n * Obtains an instance of `Quarter` from a month-of-year.\n *\n * `Quarter` is an enum representing the 4 quarters of the year.\n * This factory allows the enum to be obtained from the `Month` value.\n *\n * January to March are Q1, April to June are Q2, July to September are Q3\n * and October to December are Q4.\n *\n * @param {number} monthOfYear - the month-of-year to convert from, from 1 to 12\n * @return {Quarter} the quarter-of-year, not null\n * @throws {DateTimeException} if the month-of-year is invalid\n */\n static ofMonth(monthOfYear) {\n requireNonNull(monthOfYear, 'monthOfYear');\n ChronoField.MONTH_OF_YEAR.range().checkValidValue(monthOfYear, ChronoField.MONTH_OF_YEAR);\n return Quarter.of(MathUtil.intDiv(monthOfYear - 1, 3) + 1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `Quarter` from a temporal object.\n *\n * This obtains a quarter based on the specified temporal.\n * A `TemporalAccessor` represents an arbitrary set of date and time information,\n * which this factory converts to an instance of `Quarter`.\n *\n * The conversion extracts the {@link IsoFields.QUARTER_OF_YEAR} field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a `LocalDate`.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, `Quarter.from`.\n *\n * @param {Temporal} temporal - the temporal-time object to convert, not null\n * @return {Quarter} the quarter-of-year, not null\n * @throws {DateTimeException} if unable to convert to a `Quarter`\n */\n static from(temporal) {\n if (temporal instanceof Quarter) {\n return temporal;\n } else if (temporal instanceof Month) {\n const month = temporal;\n return Quarter.of(MathUtil.intDiv(month.ordinal(), 3) + 1);\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }\n */\n const qoy = MathUtil.safeToInt(temporal.getLong(IsoFields.QUARTER_OF_YEAR));\n return Quarter.of(qoy);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain Quarter from TemporalAccessor: '${temporal}' of type '${temporal && temporal.constructor.name}'`, ex);\n }\n }\n\n /**\n *\n * @param {number} value\n * @param {string} name\n * @private\n */\n constructor(value, name) {\n super();\n this._value = MathUtil.safeToInt(value);\n this._name = name;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the quarter-of-year `int` value.\n *\n * The values are numbered following the ISO-8601 standard,\n * from 1 (Q1) to 4 (Q4).\n *\n * @return {number} the quarter-of-year, from 1 (Q1) to 4 (Q4)\n */\n value() {\n return this._value;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the textual representation, such as 'Q1' or '4th quarter'.\n *\n * This returns the textual name used to identify the quarter-of-year,\n * suitable for presentation to the user.\n * The parameters control the style of the returned text and the locale.\n *\n * If no textual mapping is found then the {@link #getValue() numeric value} is returned.\n *\n * @param {TextStyle} style - the length of the text required, not null\n * @param {Locale} locale - the locale to use, not null\n * @return {string} the text value of the day-of-week, not null\n */\n // eslint-disable-next-line no-unused-vars\n displayName(style, locale) {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented yet!');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this quarter-of-year can be queried for the specified field.\n * If false, then calling the {@link #range(TemporalField) range} and\n * {@link #get(TemporalField) get} methods will throw an exception.\n *\n * If the field is {@link IsoFields#QUARTER_OF_YEAR QUARTER_OF_YEAR} then\n * this method returns true.\n * All `ChronoField` instances will return false.\n *\n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this quarter-of-year, false if not\n */\n isSupported(field) {\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return true;\n } else if (field instanceof ChronoField) {\n return false;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Gets the range of valid values for the specified field.\n *\n * The range object expresses the minimum and maximum valid values for a field.\n * This quarter is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is {@link IsoFields#QUARTER_OF_YEAR QUARTER_OF_YEAR} then the\n * range of the quarter-of-year, from 1 to 4, will be returned.\n * All `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n *\n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return field.range();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this quarter-of-year as an `int`.\n *\n * This queries this quarter for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is {@link IsoFields.QUARTER_OF_YEAR} then the\n * value of the quarter-of-year, from 1 to 4, will be returned.\n * All `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n *\n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field, within the valid range of values\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this quarter-of-year as a `long`.\n *\n * This queries this quarter for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *\n * If the field is {@link IsoFields#QUARTER_OF_YEAR QUARTER_OF_YEAR} then the\n * value of the quarter-of-year, from 1 to 4, will be returned.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n *\n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return this.value();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the quarter that is the specified number of quarters after this one.\n *\n * The calculation rolls around the end of the year from Q4 to Q1.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quarters - the quarters to add, positive or negative\n * @return {Quarter} the resulting quarter, not null\n */\n plus(quarters) {\n const amount = MathUtil.intMod(quarters, 4);\n return QUARTERS[(this.ordinal() + amount + 4) % 4];\n }\n\n /**\n * Returns the quarter that is the specified number of quarters before this one.\n *\n * The calculation rolls around the start of the year from Q1 to Q4.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quarters - the quarters to subtract, positive or negative\n * @return {Quarter} the resulting quarter, not null\n */\n minus(quarters) {\n return this.plus(-(MathUtil.intMod(quarters, 4)));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the length of this quarter in days.\n *\n * This takes a flag to determine whether to return the length for a leap year or not.\n *\n * Q1 has 90 in a standard year and 91 days in a leap year.\n * Q2 has 91 days.\n * Q3 and Q4 have 92 days.\n *\n * @param {boolean} leapYear - true if the length is required for a leap year\n * @return {number} the length of this month in days, from 90 to 92\n */\n length(leapYear) {\n switch (this) {\n case Quarter.Q1:\n return (leapYear ? 91 : 90);\n case Quarter.Q2:\n return 91;\n default:\n return 92;\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the first of the three months that this quarter refers to.\n *\n * Q1 will return January.\n * Q2 will return April.\n * Q3 will return July.\n * Q4 will return October.\n *\n * To obtain the other two months of the quarter, simply use {@link Month#plus(long)}\n * on the returned month.\n *\n * @return {Month} the first month in the quarter, not null\n */\n firstMonth() {\n switch (this) {\n case Quarter.Q1:\n return Month.JANUARY;\n case Quarter.Q2:\n return Month.APRIL;\n case Quarter.Q3:\n return Month.JULY;\n case Quarter.Q4:\n return Month.OCTOBER;\n default:\n throw new IllegalStateException('Unreachable');\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this quarter-of-year using the specified query.\n *\n * This queries this quarter-of-year using the specified query strategy object.\n * The `TemporalQuery` object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom(TemporalAccessor)} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return IsoFields.QUARTER_YEARS;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this quarter-of-year.\n *\n * This returns a temporal object of the same observable type as the input\n * with the quarter-of-year changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link IsoFields.QUARTER_OF_YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a `DateTimeException` is thrown.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisQuarter.adjustInto(temporal);\n * temporal = temporal.with(thisQuarter);\n * ```\n *\n * For example, given a date in May, the following are output:\n * ```\n * dateInMay.with(Q1); // three months earlier\n * dateInMay.with(Q2); // no change\n * dateInMay.with(Q3); // three months later\n * dateInMay.with(Q4); // six months later\n * ```\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }\n */\n return temporal.with(IsoFields.QUARTER_OF_YEAR, this.value());\n }\n\n //-----------------------------------------------------------------------\n // Enum\n //-----------------------------------------------------------------------\n\n /**\n *\n * @return {number}\n */\n ordinal() {\n return this._value - 1;\n }\n\n /**\n *\n * @return {string}\n */\n name() {\n return this._name;\n }\n\n //-----------------------------------------------------------------------\n // Comparable\n //-----------------------------------------------------------------------\n\n /**\n * Compares this Quarter to another Quarter.\n *\n * The comparison is based on the value of the Quarter.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Quarter} other - the other quarter to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Quarter, 'other');\n return this._value - other._value;\n }\n\n //-----------------------------------------------------------------------\n // Object\n //-----------------------------------------------------------------------\n\n /**\n * Outputs this quarter as a String, such as Q1\n *\n * @return {string} a string representation of this quarter, not null\n */\n toString() {\n return this.name();\n }\n\n /**\n *\n * @return {boolean}\n */\n equals(other){\n return this === other;\n }\n\n /**\n * A hash code for this quarter.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._value;\n }\n}\n\nlet QUARTERS;\n\nexport function _init() {\n /**\n * The singleton instance for the first quarter-of-year, from January to March.\n * This has the numeric value of `1`.\n */\n Quarter.Q1 = new Quarter(1, 'Q1');\n /**\n * The singleton instance for the second quarter-of-year, from April to June.\n * This has the numeric value of `2`.\n */\n Quarter.Q2 = new Quarter(2, 'Q2');\n /**\n * The singleton instance for the third quarter-of-year, from July to September.\n * This has the numeric value of `3`.\n */\n Quarter.Q3 = new Quarter(3, 'Q3');\n /**\n * The singleton instance for the fourth quarter-of-year, from October to December.\n * This has the numeric value of `4`.\n */\n Quarter.Q4 = new Quarter(4, 'Q4');\n\n Quarter.FROM = createTemporalQuery('Quarter.FROM', (temporal) => {\n return Quarter.from(temporal);\n });\n\n QUARTERS = [\n Quarter.Q1,\n Quarter.Q2,\n Quarter.Q3,\n Quarter.Q4\n ];\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/**\n * @copyright (c) 2015-present, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { requireNonNull } from './assert';\nimport { ChronoField, ChronoUnit, DateTimeException, DateTimeParseException, IsoFields, ParsePosition, TemporalAdjuster, UnsupportedTemporalTypeException } from '@js-joda/core';\n\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * Additional utilities for working with temporal classes.\n * \n * This includes:\n * - adjusters that ignore Saturday/Sunday weekends\n * - conversion between `TimeUnit` and `ChronoUnit`\n * - converting an amount to another unit\n *\n */\nexport class Temporals {\n //-------------------------------------------------------------------------\n /**\n * Returns an adjuster that returns the next working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n *\n * @return {TemporalAdjuster} the next working day adjuster, not null\n */\n static nextWorkingDay() {\n return Adjuster.NEXT_WORKING;\n }\n\n /**\n * Returns an adjuster that returns the next working day or same day if already working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n * \n * @return {TemporalAdjuster} the next working day or same adjuster, not null\n */\n static nextWorkingDayOrSame() {\n return Adjuster.NEXT_WORKING_OR_SAME;\n }\n\n /**\n * Returns an adjuster that returns the previous working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n *\n * @return {TemporalAdjuster} the previous working day adjuster, not null\n */\n static previousWorkingDay() {\n return Adjuster.PREVIOUS_WORKING;\n }\n\n /**\n * Returns an adjuster that returns the previous working day or same day if already working day, ignoring Saturday and Sunday.\n * \n * Some territories have weekends that do not consist of Saturday and Sunday.\n * No implementation is supplied to support this, however an adjuster\n * can be easily written to do so.\n * \n * @return {TemporalAdjuster} the previous working day or same adjuster, not null\n */\n static previousWorkingDayOrSame() {\n return Adjuster.PREVIOUS_WORKING_OR_SAME;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Parses the text using one of the formatters.\n * \n * This will try each formatter in turn, attempting to fully parse the specified text.\n * The temporal query is typically a method reference to a `from(TemporalAccessor)` method.\n * For example:\n * ```\n * LocalDateTime dt = Temporals.parseFirstMatching(str, LocalDateTime.FROM, fm1, fm2, fm3);\n * ```\n * If the parse completes without reading the entire length of the text,\n * or a problem occurs during parsing or merging, then an exception is thrown.\n *\n * @param {string} text the text to parse, not null\n * @param {TemporalQuery} query the query defining the type to parse to, not null\n * @param {DateTimeFormatter[]} formatters the formatters to try, not null\n * @return {*} the parsed date-time, not null\n * @throws {DateTimeParseException} if unable to parse the requested result\n */\n static parseFirstMatching(text, query, ...formatters) {\n requireNonNull(text, 'text');\n requireNonNull(query, 'query');\n requireNonNull(formatters, 'formatters');\n if (formatters.length === 0) {\n throw new DateTimeParseException('No formatters specified', text, 0);\n }\n if (formatters.length === 1) {\n return formatters[0].parse(text, query);\n }\n for (const formatter of formatters) {\n try {\n const pp = new ParsePosition(0);\n formatter.parseUnresolved(text, pp);\n const len = text.length;\n if (pp.getErrorIndex() === -1 && pp.getIndex() === len) {\n return formatter.parse(text, query);\n }\n } catch (ignored) {\n // should not happen, but ignore if it does\n }\n }\n throw new DateTimeParseException(`Text '${text}' could not be parsed`, text, 0);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Converts an amount from one unit to another.\n * \n * This works on the units in `ChronoUnit` and `IsoFields`.\n * The `DAYS` and `WEEKS` units are handled as exact multiple of 24 hours.\n * The `ERAS` and `FOREVER` units are not supported.\n *\n * @param {long} amount the input amount in terms of the `fromUnit`\n * @param {TemporalUnit} fromUnit the unit to convert from, not null\n * @param {TemporalUnit} toUnit the unit to convert to, not null\n * @return {long[]} the conversion array,\n * element 0 is the signed whole number,\n * element 1 is the signed remainder in terms of the input unit,\n * not null\n * @throws DateTimeException if the units cannot be converted\n * @throws UnsupportedTemporalTypeException if the units are not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n static convertAmount(amount, fromUnit, toUnit) {\n requireNonNull(fromUnit, 'fromUnit');\n requireNonNull(toUnit, 'toUnit');\n Temporals._validateUnit(fromUnit);\n Temporals._validateUnit(toUnit);\n if (fromUnit === toUnit) {\n return [amount, 0];\n }\n // precise-based\n if (Temporals._isPrecise(fromUnit) && Temporals._isPrecise(toUnit)) {\n const fromNanos = fromUnit.duration().toNanos();\n const toNanos = toUnit.duration().toNanos();\n if (fromNanos > toNanos) {\n const multiple = MathUtil.intDiv(fromNanos, toNanos);\n return [MathUtil.safeMultiply(amount, multiple), 0];\n } else {\n const multiple = MathUtil.intDiv(toNanos, fromNanos);\n return [MathUtil.intDiv(amount, multiple), MathUtil.intMod(amount, multiple)];\n }\n }\n // month-based\n const fromMonthFactor = Temporals._monthMonthFactor(fromUnit, fromUnit, toUnit);\n const toMonthFactor = Temporals._monthMonthFactor(toUnit, fromUnit, toUnit);\n if (fromMonthFactor > toMonthFactor) {\n const multiple = MathUtil.intDiv(fromMonthFactor, toMonthFactor);\n return [MathUtil.safeMultiply(amount, multiple), 0];\n } else {\n const multiple = MathUtil.intDiv(toMonthFactor, fromMonthFactor);\n return [MathUtil.intDiv(amount, multiple), MathUtil.intMod(amount, multiple)];\n }\n }\n\n /**\n * \n * @param {TemporalUnit} unit\n * @private\n */\n static _validateUnit(unit) {\n if (unit instanceof ChronoUnit) {\n if (unit === ChronoUnit.ERAS || unit === ChronoUnit.FOREVER) {\n throw new UnsupportedTemporalTypeException(`Unsupported TemporalUnit: ${unit}`);\n }\n } else if (unit !== IsoFields.QUARTER_YEARS) {\n throw new UnsupportedTemporalTypeException(`Unsupported TemporalUnit: ${unit}`);\n }\n }\n\n /**\n * \n * @param {TemporalUnit} unit\n * @return {boolean}\n * @private\n */\n static _isPrecise(unit) {\n return unit instanceof ChronoUnit && unit.compareTo(ChronoUnit.WEEKS) <= 0;\n }\n\n /**\n * \n * @param {TemporalUnit} unit\n * @param {TemporalUnit} fromUnit\n * @param {TemporalUnit} toUnit\n * @return {int}\n * @private\n */\n static _monthMonthFactor(unit, fromUnit, toUnit) {\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.MONTHS:\n return 1;\n case ChronoUnit.YEARS:\n return 12;\n case ChronoUnit.DECADES:\n return 120;\n case ChronoUnit.CENTURIES:\n return 1200;\n case ChronoUnit.MILLENNIA:\n return 12000;\n default:\n throw new DateTimeException(`Unable to convert between units: ${fromUnit} to ${toUnit}`);\n }\n }\n return 3; // quarters\n }\n\n /**\n * Restricted constructor.\n * \n * @private\n */\n constructor() {\n }\n}\n\nconst Adjuster = {};\n\nexport function _init() {\n /** Next working day adjuster. */\n Adjuster.NEXT_WORKING = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 6: // Saturday\n return temporal.plus(2, ChronoUnit.DAYS);\n case 5: // Friday\n return temporal.plus(3, ChronoUnit.DAYS);\n default:\n return temporal.plus(1, ChronoUnit.DAYS);\n }\n }\n };\n\n /** Previous working day adjuster. */\n Adjuster.PREVIOUS_WORKING = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 1: // Monday\n return temporal.minus(3, ChronoUnit.DAYS);\n case 7: // Sunday\n return temporal.minus(2, ChronoUnit.DAYS);\n default:\n return temporal.minus(1, ChronoUnit.DAYS);\n }\n }\n };\n\n /** Next working day or same adjuster. */\n Adjuster.NEXT_WORKING_OR_SAME = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 6: // Saturday\n return temporal.plus(2, ChronoUnit.DAYS);\n case 7: // Sunday\n return temporal.plus(1, ChronoUnit.DAYS);\n default:\n return temporal;\n }\n }\n };\n\n /** Previous working day or same adjuster. */\n Adjuster.PREVIOUS_WORKING_OR_SAME = new class extends TemporalAdjuster {\n adjustInto(temporal) {\n const dow = temporal.get(ChronoField.DAY_OF_WEEK);\n switch (dow) {\n case 6: //Saturday\n return temporal.minus(1, ChronoUnit.DAYS);\n case 7: // Sunday\n return temporal.minus(2, ChronoUnit.DAYS);\n default:\n return temporal;\n }\n }\n };\n}\n","/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, ChronoUnit, Clock, DateTimeException, DateTimeFormatter, DateTimeFormatterBuilder, IllegalArgumentException, IsoChronology, IsoFields, LocalDate, SignStyle, Temporal, TemporalField, TemporalQueries, TemporalQuery, TemporalUnit, UnsupportedTemporalTypeException, ValueRange, Year, ZoneId } from '@js-joda/core';\nimport { Quarter } from './Quarter';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A year-quarter in the ISO-8601 calendar system, such as `2007-Q2`.\n * \n * `YearQuarter` is an immutable date-time object that represents the combination\n * of a year and quarter. Any field that can be derived from a year and quarter can be obtained.\n * A quarter is defined by {@link Quarter} and {@link Month.firstMonthOfQuarter} - Q1, Q2, Q3 and Q4.\n * Q1 is January to March, Q2 is April to June, Q3 is July to September and Q4 is October to December.\n * \n * This class does not store or represent a day, time or time-zone.\n * For example, the value '2nd quarter 2007' can be stored in a `YearQuarter`.\n * \n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n * Note that the ISO-8601 standard does not define or refer to quarters.\n *\n */\nexport class YearQuarter extends Temporal {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearQuarter.now}\n * - if called with 0 argument {@link YearQuarter._now0} is executed,\n * - if called with 1 argument and first argument is an instance of ZoneId, then {@link YearQuarter._nowZoneId} is executed,\n * - otherwise {@link YearQuarter._nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {YearQuarter}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return YearQuarter._now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return YearQuarter._nowZoneId(zoneIdOrClock);\n } else {\n return YearQuarter._nowClock(zoneIdOrClock);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current year-quarter from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current year-quarter.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {YearQuarter} the current year-quarter using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return YearQuarter.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year-quarter from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} to obtain the current year-quarter.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {YearQuarter} the current year-quarter using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return YearQuarter.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current year-quarter from the specified clock.\n * \n * This will query the specified clock to obtain the current year-quarter.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {YearQuarter} the current year-quarter, not null\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return YearQuarter.of(now.getYear(), Quarter.from(now.getMonth()));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearQuarter.of}\n * - if called with {Year} and {Quarter} {@link YearQuarter._ofYearQuarter} is executed,\n * - if called with {Year} and {number} {@link YearQuarter._ofYearInt} is executed,\n * - if called with {number} and {Quarter} {@link YearQuarter._ofIntQuarter} is executed,\n * - if called with {number} and {number} {@link YearQuarter._ofIntInt} is executed,\n * otherwise throws IllegalArgumentException.\n *\n * @param {Year|number} year\n * @param {Quarter|number} quarter\n * @return {YearQuarter}\n */\n static of(year, quarter) {\n if (year instanceof Year && quarter instanceof Quarter) {\n return YearQuarter._ofYearQuarter(year, quarter);\n }\n if (year instanceof Year && typeof quarter === 'number') {\n return YearQuarter._ofYearInt(year, quarter);\n }\n if (typeof year === 'number' && quarter instanceof Quarter) {\n return YearQuarter._ofIntQuarter(year, quarter);\n }\n if (typeof year === 'number' && typeof quarter === 'number') {\n return YearQuarter._ofIntInt(year, quarter);\n }\n // FIXME\n const yearMessage = `year must be an instance of Year or number but is ${year.constructor.name}`;\n const quarterMessage = `quarter must be an instance of Quarter or number but is ${quarter.constructor.name}`;\n throw new IllegalArgumentException(`${yearMessage} and ${quarterMessage}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {Year} year - the year to represent, not null\n * @param {Quarter} quarter - the quarter-of-year to represent, not null\n * @return {YearQuarter} the year-quarter, not null\n * @protected\n */\n // FIXME ambiguous name?\n static _ofYearQuarter(year, quarter) {\n return YearQuarter.of(year.value(), quarter);\n }\n\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {Year} year - the year to represent, not null\n * @param {number} quarter - the quarter-of-year to represent, from 1 to 4\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if the quarter value is invalid\n * @protected\n */\n static _ofYearInt(year, quarter) {\n return YearQuarter.of(year.value(), Quarter.of(quarter));\n }\n\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {Quarter} quarter - the quarter-of-year to represent, not null\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if the year value is invalid\n * @protected\n */\n static _ofIntQuarter(year, quarter) {\n ChronoField.YEAR.checkValidValue(year);\n requireNonNull(quarter, 'quarter');\n return new YearQuarter(year, quarter);\n }\n\n /**\n * Obtains an instance of `YearQuarter` from a year and quarter.\n *\n * @param {number} year - the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} quarter - the quarter-of-year to represent, from 1 to 4\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if either field value is invalid\n * @protected\n */\n static _ofIntInt(year, quarter) {\n ChronoField.YEAR.checkValidValue(year);\n return new YearQuarter(year, Quarter.of(quarter));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `YearQuarter` from a temporal object.\n * \n * This obtains a year-quarter based on the specified temporal.\n * A `TemporalAccessor` represents an arbitrary set of date and time information,\n * which this factory converts to an instance of `YearQuarter`.\n * \n * The conversion extracts the {@link ChronoField.YEAR} and\n * {@link IsoFields.QUARTER_OF_YEAR} fields.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a `LocalDate`.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, `YearQuarter.FROM`.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {YearQuarter} the year-quarter, not null\n * @throws {DateTimeException} if unable to convert to a `YearQuarter`\n */\n static from(temporal) {\n if (temporal instanceof YearQuarter) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }\n */\n // need to use getLong() as JDK Parsed class get() doesn't work properly\n const year = MathUtil.safeToInt(temporal.getLong(ChronoField.YEAR));\n const qoy = MathUtil.safeToInt(temporal.getLong(IsoFields.QUARTER_OF_YEAR));\n return YearQuarter.of(year, qoy);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain YearQuarter from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of `YearQuarter` from a text string using a specific formatter.\n * \n * The text is parsed using the formatter, returning a year-quarter.\n *\n * @param {string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=YearQuarter.PARSER] - the formatter to use, default is {@link YearQuarter.PARSER}\n * @return {YearQuarter} the parsed year-quarter, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = YearQuarter.PARSER) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.parse(text, YearQuarter.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {number} year - the year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {Quarter} quarter - the quarter-of-year to represent, validated not null\n * @private\n */\n constructor(year, quarter) {\n super();\n this._year = MathUtil.safeToInt(year);\n this._quarter = requireInstance(quarter, Quarter, 'Quarter');\n }\n\n /**\n * Returns a copy of this year-quarter with the new year and quarter, checking\n * to see if a new object is in fact required.\n *\n * @param {number} newYear - the year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {Quarter} newQuarter - the quarter-of-year to represent, validated not null\n * @return {YearQuarter} the year-quarter, not null\n * @private\n */\n _with(newYear, newQuarter) {\n if (this._year === newYear && this._quarter === newQuarter) {\n return this;\n }\n return new YearQuarter(newYear, newQuarter);\n }\n\n /**\n * function overloading for {@link YearWeek.isSupported}\n * - if called with an instance of {@link TemporalField}, then {@link YearWeek.isSupportedField} is executed,\n * - if called with an instance of {@link TemporalUnit}, then {@link YearWeek.isSupportedUnit} is executed,\n * - otherwise {@link IllegalArgumentException} is thrown.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit\n * @return {boolean}\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof TemporalField) {\n return this._isSupportedField(fieldOrUnit);\n }\n if (fieldOrUnit instanceof TemporalUnit) {\n return this._isSupportedUnit(fieldOrUnit);\n }\n if (fieldOrUnit == null) {\n return false;\n }\n throw new IllegalArgumentException(`fieldOrUnit must be an instance of TemporalField or TemporalUnit, but is ${fieldOrUnit.constructor.name}`);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this year-quarter can be queried for the specified field.\n * If false, then calling the {@link YearQuarter.range},\n * {@link YearQuarter.get} and {@link YearQuarter.with}\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * \n * - `QUARTER_OF_YEAR`\n * - `YEAR_OF_ERA`\n * - `YEAR`\n * - `ERA`\n * \n * All other `ChronoField` instances will return false.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.isSupportedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this year-quarter, false if not\n * @protected\n */\n _isSupportedField(field) {\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return true;\n } else if (field instanceof ChronoField) {\n return field === ChronoField.YEAR || field === ChronoField.YEAR_OF_ERA || field === ChronoField.ERA;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n * \n * This checks if the specified unit can be added to, or subtracted from, this year-quarter.\n * If false, then calling the {@link YearQuarter.plus} and\n * {@link YearQuarter.minus} methods will throw an exception.\n * \n * If the unit is a {@link ChronoUnit} then the query is implemented here.\n * The supported units are:\n * \n * - `QUARTER_YEARS`\n * - `YEARS`\n * - `DECADES`\n * - `CENTURIES`\n * - `MILLENNIA`\n * - `ERAS`\n * \n * All other `ChronoUnit` instances will return false.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.isSupportedBy(Temporal)`\n * passing `this` as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if the unit can be added/subtracted, false if not\n * @protected\n */\n _isSupportedUnit(unit) {\n if (unit === IsoFields.QUARTER_YEARS) {\n return true;\n } else if (unit instanceof ChronoUnit) {\n return unit === ChronoUnit.YEARS || unit === ChronoUnit.DECADES || unit === ChronoUnit.CENTURIES || unit === ChronoUnit.MILLENNIA || unit === ChronoUnit.ERAS;\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This year-quarter is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link YearQuarter.isSupported} supported fields will return\n * appropriate range instances.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)`\n * passing `this` as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return IsoFields.QUARTER_OF_YEAR.range();\n }\n if (field === ChronoField.YEAR_OF_ERA) {\n return (this.year() <= 0 ? ValueRange.of(1, Year.MAX_VALUE + 1) : ValueRange.of(1, Year.MAX_VALUE));\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this year-quarter as an `int`.\n * \n * This queries this year-quarter for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link YearQuarter.isSupported} supported fields will return valid\n * values based on this year-quarter,.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this year-quarter as a `long`.\n * \n * This queries this year-quarter for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link YearQuarter.isSupported} supported fields will return valid\n * values based on this year-quarter.\n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.getFrom(TemporalAccessor)`\n * passing `this` as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return this._quarter.value();\n } else if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.YEAR_OF_ERA:\n return (this._year < 1 ? 1 - this._year : this._year);\n case ChronoField.YEAR:\n return this._year;\n case ChronoField.ERA:\n return (this._year < 1 ? 0 : 1);\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n }\n return super.get(field);\n }\n\n /**\n * @private\n */\n _prolepticQuarter() {\n return this._year * 4 + (this._quarter.value() - 1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the year field.\n * \n * This method returns the primitive `int` value for the year.\n * \n * The year returned by this method is proleptic as per `get(YEAR)`.\n *\n * @return {number} the year, from MIN_YEAR to MAX_YEAR\n */\n year() {\n return this._year;\n }\n\n /**\n * Gets the quarter-of-year field from 1 to 4.\n * \n * This method returns the quarter as an `int` from 1 to 4.\n * Application code is frequently clearer if the enum {@link Quarter}\n * is used by calling {@link YearQuarter.getQuarter}.\n *\n * @return {number} the quarter-of-year, from 1 to 4\n * @see {@link YearQuarter.quarter}\n */\n quarterValue() {\n return this._quarter.value();\n }\n\n /**\n * Gets the quarter-of-year field using the `Quarter` enum.\n * \n * This method returns the enum {@link Quarter} for the quarter.\n * This avoids confusion as to what `int` values mean.\n * If you need access to the primitive `int` value then the enum\n * provides the {@link Quarter.value}.\n *\n * @return {Quarter} the quarter-of-year, not null\n * @see {@link YearQuarter.quarterValue}\n */\n quarter() {\n return this._quarter;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is a leap year, according to the ISO proleptic\n * calendar system rules.\n * \n * This method applies the current rules for leap years across the whole time-line.\n * In general, a year is a leap year if it is divisible by four without\n * remainder. However, years divisible by 100, are not leap years, with\n * the exception of years divisible by 400 which are.\n * \n * For example, 1904 is a leap year it is divisible by 4.\n * 1900 was not a leap year as it is divisible by 100, however 2000 was a\n * leap year as it is divisible by 400.\n * \n * The calculation is proleptic - applying the same rules into the far future and far past.\n * This is historically inaccurate, but is correct for the ISO-8601 standard.\n *\n * @return {boolean} true if the year is leap, false otherwise\n */\n isLeapYear() {\n return IsoChronology.isLeapYear(this._year);\n }\n\n /**\n * Checks if the day-of-quarter is valid for this year-quarter.\n * \n * This method checks whether this year and quarter and the input day form\n * a valid date.\n *\n * @param {number} dayOfQuarter - the day-of-quarter to validate, from 1 to 92, invalid value returns false\n * @return {boolean} true if the day is valid for this year-quarter\n */\n isValidDay(dayOfQuarter) {\n return dayOfQuarter >= 1 && dayOfQuarter <= this.lengthOfQuarter();\n }\n\n /**\n * Returns the length of the quarter, taking account of the year.\n * \n * This returns the length of the quarter in days.\n *\n * @return {number} the length of the quarter in days, from 90 to 92\n */\n lengthOfQuarter() {\n return this._quarter.length(this.isLeapYear());\n }\n\n /**\n * Returns the length of the year.\n * \n * This returns the length of the year in days, either 365 or 366.\n *\n * @return {number} 366 if the year is leap, 365 otherwise\n */\n lengthOfYear() {\n return (this.isLeapYear() ? 366 : 365);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this year-quarter.\n * \n * This returns a {@code YearQuarter} based on this one, with the year-quarter adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n * \n * A simple adjuster might simply set the one of the fields, such as the year field.\n * A more complex adjuster might set the year-quarter to the next quarter that\n * Halley's comet will pass the Earth.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto(Temporal)} method on the\n * specified adjuster passing {@code this} as the argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {YearQuarter} based on {@code this} with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof YearQuarter) {\n return adjuster;\n }\n return super._withAdjuster(adjuster);\n }\n\n /**\n * Returns a copy of this year-quarter with the specified field set to a new value.\n * \n * This returns a `YearQuarter` based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year or quarter.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n * - `QUARTER_OF_YEAR` -\n * Returns a `YearQuarter` with the specified quarter-of-year.\n * The year will be unchanged.\n * - `YEAR_OF_ERA` -\n * Returns a `YearQuarter` with the specified year-of-era\n * The quarter and era will be unchanged.\n * - `YEAR` -\n * Returns a `YearQuarter` with the specified year.\n * The quarter will be unchanged.\n * - `ERA` -\n * Returns a `YearQuarter` with the specified era.\n * The quarter and year-of-era will be unchanged.\n * \n * In all cases, if the new value is outside the valid range of values for the field\n * then a `DateTimeException` will be thrown.\n * \n * All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoField`, then the result of this method\n * is obtained by invoking `TemporalField.adjustInto(Temporal, long)`\n * passing `this` as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {YearQuarter} a `YearQuarter` based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withField(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field === IsoFields.QUARTER_OF_YEAR) {\n return this.withQuarter(IsoFields.QUARTER_OF_YEAR.range().checkValidIntValue(newValue, IsoFields.QUARTER_OF_YEAR));\n } else if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.YEAR_OF_ERA:\n return this.withYear(this._year < 1 ? 1 - newValue : newValue);\n case ChronoField.YEAR:\n return this.withYear(newValue);\n case ChronoField.ERA:\n return this.getLong(ChronoField.ERA) === newValue ? this : this.withYear(1 - this._year);\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this `YearQuarter` with the year altered.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year - the year to set in the returned year-quarter, from MIN_YEAR to MAX_YEAR\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n ChronoField.YEAR.checkValidValue(year);\n return this._with(year, this._quarter);\n }\n\n /**\n * Returns a copy of this `YearQuarter` with the quarter-of-year altered.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quarter - the quarter-of-year to set in the returned year-quarter, from 1 to 4\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the requested quarter, not null\n * @throws {DateTimeException} if the quarter-of-year value is invalid\n */\n withQuarter(quarter) {\n IsoFields.QUARTER_OF_YEAR.range().checkValidValue(quarter, IsoFields.QUARTER_OF_YEAR);\n return this._with(this._year, Quarter.of(quarter));\n }\n\n /**\n * Returns a copy of this year-quarter with the specified amount added.\n * \n * This returns a `YearQuarter` based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoUnit} then the addition is implemented here.\n * The supported fields behave as follows:\n * \n * - `QUARTER_YEARS` -\n * Returns a `YearQuarter` with the specified number of quarters added.\n * This is equivalent to {@link YearQuarter.plusQuarters}.\n * - `YEARS` -\n * Returns a `YearQuarter` with the specified number of years added.\n * This is equivalent to {@link YearQuarter.plusYears}.\n * - `DECADES` -\n * Returns a `YearQuarter` with the specified number of decades added.\n * This is equivalent to calling {@link YearQuarter.plusYears} with the amount\n * multiplied by 10.\n * - `CENTURIES` -\n * Returns a `YearQuarter` with the specified number of centuries added.\n * This is equivalent to calling {@link YearQuarter.plusYears} with the amount\n * multiplied by 100.\n * - `MILLENNIA` -\n * Returns a `YearQuarter` with the specified number of millennia added.\n * This is equivalent to calling {@link YearQuarter.plusYears} with the amount\n * multiplied by 1,000.\n * - `ERAS` -\n * Returns a `YearQuarter` with the specified number of eras added.\n * Only two eras are supported so the amount must be one, zero or minus one.\n * If the amount is non-zero then the year is changed such that the year-of-era\n * is unchanged.\n * \n * All other `ChronoUnit` instances will throw an `UnsupportedTemporalTypeException`.\n * \n * If the field is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.addTo(Temporal, long)`\n * passing `this` as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to add, not null\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the specified amount added, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _plusUnit(amountToAdd, unit) {\n if (unit === IsoFields.QUARTER_YEARS) {\n return this.plusQuarters(amountToAdd);\n } else if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.YEARS:\n return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES:\n return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES:\n return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA:\n return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS:\n return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in years added.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToAdd - the years to add, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n const newYear = ChronoField.YEAR.checkValidIntValue(this._year + yearsToAdd); // safe overflow\n return this._with(newYear, this._quarter);\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in quarters added.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quartersToAdd - the quarters to add, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the quarters added, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n plusQuarters(quartersToAdd) {\n if (quartersToAdd === 0) {\n return this;\n }\n const quarterCount = this._year * 4 + (this._quarter.value() - 1);\n const calcQuarters = quarterCount + quartersToAdd; // safe overflow\n const newYear = ChronoField.YEAR.checkValidIntValue(MathUtil.intDiv(calcQuarters, 4));\n const newQuarter = MathUtil.floorMod(calcQuarters, 4) + 1;\n return this._with(newYear, Quarter.of(newQuarter));\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in years subtracted.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} yearsToSubtract - the years to subtract, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n minusYears(yearsToSubtract) {\n return (yearsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusYears(MathUtil.MIN_SAFE_INTEGER).plusYears(1) : this.plusYears(-yearsToSubtract));\n }\n\n /**\n * Returns a copy of this year-quarter with the specified period in quarters subtracted.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} quartersToSubtract - the quarters to subtract, may be negative\n * @return {YearQuarter} a `YearQuarter` based on this year-quarter with the quarters subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported range\n */\n minusQuarters(quartersToSubtract) {\n return (quartersToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusQuarters(MathUtil.MIN_SAFE_INTEGER).plusQuarters(1) : this.plusQuarters(-quartersToSubtract));\n\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year-quarter using the specified query.\n * \n * This queries this year-quarter using the specified query strategy object.\n * The `TemporalQuery` object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing `this` as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return IsoFields.QUARTER_YEARS;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this year-quarter.\n * \n * This returns a temporal object of the same observable type as the input\n * with the year and quarter changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.plus}\n * passing the number of quarters to adjust by.\n * If the specified temporal object does not use the ISO calendar system then\n * a `DateTimeException` is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisYearQuarter.adjustInto(temporal);\n * temporal = temporal.with(thisYearQuarter);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }*/\n const newProlepticQuarter = this._prolepticQuarter();\n const oldProlepticQuarter = temporal.get(ChronoField.YEAR) * 4 + (temporal.get(IsoFields.QUARTER_OF_YEAR) - 1);\n return temporal.plus(newProlepticQuarter - oldProlepticQuarter, IsoFields.QUARTER_YEARS);\n }\n\n /**\n * Calculates the amount of time until another year-quarter in terms of the specified unit.\n * \n * This calculates the amount of time between two `YearQuarter`\n * objects in terms of a single `TemporalUnit`.\n * The start and end points are `this` and the specified year-quarter.\n * The result will be negative if the end is before the start.\n * The `Temporal` passed to this method is converted to a\n * `YearQuarter` using {@link YearQuarter.from}.\n * For example, the period in years between two year-quarters can be calculated\n * using `startYearQuarter.until(endYearQuarter, YEARS)`.\n * \n * The calculation returns a whole number, representing the number of\n * complete units between the two year-quarters.\n * For example, the period in decades between 2012-Q3 and 2032-Q2\n * will only be one decade as it is one quarter short of two decades.\n * \n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit.between}:\n * <pre>\n * // these two lines are equivalent\n * amount = start.until(end, QUARTER_YEARS);\n * amount = QUARTER_YEARS.between(start, end);\n * </pre>\n * The choice should be made based on which makes the code more readable.\n * \n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units `QUARTER_YEARS`, `YEARS`, `DECADES`,\n * `CENTURIES`, `MILLENNIA` and `ERAS` are supported.\n * Other `ChronoUnit` values will throw an exception.\n * \n * If the unit is not a `ChronoUnit`, then the result of this method\n * is obtained by invoking `TemporalUnit.between(Temporal, Temporal)`\n * passing `this` as the first argument and the converted input temporal\n * as the second argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date, exclusive, which is converted to a `YearQuarter`, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this year-quarter and the end year-quarter\n * @throws {DateTimeException} if the amount cannot be calculated, or the end\n * temporal cannot be converted to a `YearQuarter`\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n requireInstance(endExclusive, Temporal, 'endExclusive');\n requireInstance(unit, TemporalUnit, 'unit');\n\n const end = YearQuarter.from(endExclusive);\n const quartersUntil = end._prolepticQuarter() - this._prolepticQuarter(); // no overflow\n if (unit === IsoFields.QUARTER_YEARS) {\n return quartersUntil;\n } else if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.YEARS:\n return MathUtil.intDiv(quartersUntil, 4);\n case ChronoUnit.DECADES:\n return MathUtil.intDiv(quartersUntil, 40);\n case ChronoUnit.CENTURIES:\n return MathUtil.intDiv(quartersUntil, 400);\n case ChronoUnit.MILLENNIA:\n return MathUtil.intDiv(quartersUntil, 4000);\n case ChronoUnit.ERAS:\n return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n default:\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n }\n return unit.between(this, end);\n }\n\n /**\n * Formats this year-quarter using the specified formatter.\n * \n * This year-quarter will be passed to the formatter to produce a string.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted year-quarter string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year-quarter with a day-of-quarter to create a `LocalDate`.\n * \n * This returns a `LocalDate` formed from this year-quarter and the specified day-of-quarter.\n * \n * The day-of-quarter value must be valid for the year-quarter.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = yearQuarter.atDay(day);\n * ```\n *\n * @param {number} dayOfQuarter the day-of-quarter to use, from 1 to 92\n * @return {LocalDate} the date formed from this year-quarter and the specified day, not null\n * @throws {DateTimeException} if the day is invalid for the year-quarter\n * @see {@link YearQuarter.isValidDay}\n */\n atDay(dayOfQuarter) {\n ValueRange.of(1, this.lengthOfQuarter()).checkValidValue(dayOfQuarter, IsoFields.DAY_OF_QUARTER);\n const leap = Year.isLeap(this._year);\n let month = this._quarter.firstMonth();\n while (dayOfQuarter > month.length(leap)) {\n dayOfQuarter -= month.length(leap);\n month = month.plus(1);\n }\n return LocalDate.of(this._year, month, dayOfQuarter);\n }\n\n /**\n * Returns a `LocalDate` at the end of the quarter.\n * \n * This returns a `LocalDate` based on this year-quarter.\n * The day-of-quarter is set to the last valid day of the quarter, taking\n * into account leap years.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = year.atQuarter(quarter).atEndOfQuarter();\n * ```\n *\n * @return {LocalDate} the last valid date of this year-quarter, not null\n */\n atEndOfQuarter() {\n const month = this._quarter.firstMonth().plus(2);\n return LocalDate.of(this._year, month, month.maxLength());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this year-quarter to another\n * \n * The comparison is based first on the value of the year, then on the value of the quarter.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param {YearQuarter} other - the other year-quarter to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, YearQuarter, 'other');\n let cmp = (this._year - other._year);\n if (cmp === 0) {\n cmp = this._quarter.compareTo(other._quarter);\n }\n return cmp;\n }\n\n /**\n * Is this year-quarter after the specified year-quarter.\n *\n * @param {YearQuarter} other - the other year-quarter to compare to, not null\n * @return {boolean} true if this is after the specified year-quarter\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this year-quarter before the specified year-quarter.\n *\n * @param {YearQuarter} other - the other year-quarter to compare to, not null\n * @return {boolean} true if this point is before the specified year-quarter\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this year-quarter is equal to another year-quarter.\n * \n * The comparison is based on the time-line position of the year-quarters.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other year-quarter\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof YearQuarter) {\n const other = obj;\n return this._year === other._year && this._quarter === other._quarter;\n }\n return false;\n }\n\n /**\n * A hash code for this year-quarter.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._year ^ (this._quarter.value() << 27);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this year-quarter as a `String`, such as `2007-Q2`.\n * \n * The output will be in the format `uuuu-'Q'Q`:\n *\n * @return {string} a string representation of this year-quarter, not null\n */\n toString() {\n let yearString;\n const yearValue = this._year;\n const absYear = Math.abs(yearValue);\n if (absYear < 1000) {\n if (yearValue < 0) {\n yearString = `-${(`${yearValue - 10000}`).slice(-4)}`;\n } else {\n yearString = (`${yearValue + 10000}`).slice(-4);\n }\n } else {\n if (yearValue > 9999) {\n yearString = `+${yearValue}`;\n } else {\n yearString = `${yearValue}`;\n }\n }\n return yearString.concat('-').concat(this._quarter);\n }\n}\n\nexport function _init() {\n YearQuarter.PARSER = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendLiteral('Q')\n .appendValue(IsoFields.QUARTER_OF_YEAR, 1)\n .toFormatter();\n\n YearQuarter.FROM = createTemporalQuery('YearQuarter.FROM', (temporal) => {\n return YearQuarter.from(temporal);\n });\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, ChronoUnit, Clock, DateTimeException, DateTimeFormatterBuilder, DayOfWeek, IllegalArgumentException, IsoChronology, IsoFields, LocalDate, NullPointerException, SignStyle, Temporal, TemporalField, TemporalQueries, TemporalQuery, TemporalUnit, UnsupportedTemporalTypeException, ValueRange, Year, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { assert, requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A year-week in the ISO week date system such as `2015-W13`\n * \n * {@link YearWeek} is an immutable date-time object that represents the combination\n * of a week-based-year and week-of-week-based-year.\n * Any field that can be derived from those two fields can be obtained.\n * \n * This class does not store or represent a day, time or time-zone.\n * For example, the value '13th week of 2007' can be stored in a {@link YearWeek}.\n * \n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. It is equivalent to the proleptic Gregorian calendar\n * system, in which today's rules for leap years are applied for all time.\n * For most applications written today, the ISO-8601 rules are entirely suitable.\n * However, any application that makes use of historical dates, and requires them\n * to be accurate will find the ISO-8601 approach unsuitable.\n * \n * ISO-8601 defines the week as always starting with Monday.\n * The first week is the week which contains the first Thursday of the calendar year.\n * As such, the week-based-year used in this class does not align with the calendar year.\n */\nexport class YearWeek extends Temporal {\n /**\n * Function overloading for {@link YearWeek.now}:\n * - if called with no arguments, {@link YearWeek._now0} is executed;\n * - if called with an instance of {@link ZoneId}, then {@link YearWeek._nowZoneId} is executed;\n * - if called with an instance of {@link Clock}, then {@link YearWeek._nowClock} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @return {YearWeek}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return YearWeek._now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return YearWeek._nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return YearWeek._nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current year-week from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current year-week.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return {YearWeek} the current year-week using the system clock and default time-zone, not null\n * @protected\n */\n static _now0() {\n return YearWeek.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year-week from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current year-week.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param {ZoneId} zone - the zone ID to use, not null\n * @return {YearWeek} the current year-week using the system clock, not null\n * @protected\n */\n static _nowZoneId(zone) {\n return YearWeek.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current year-week from the specified clock.\n * \n * This will query the specified clock to obtain the current year-week.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param {Clock} clock - the clock to use, not null\n * @return {YearWeek} the current year-week, not null\n * @protected\n */\n static _nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return YearWeek.of(now.get(IsoFields.WEEK_BASED_YEAR), now.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Function overloading for {@link YearWeek.of}:\n * - if called with an instances of {@link Year} and `int`, then {@link YearWeek._ofYearWeek} is executed;\n * - if called with an instances of number and `int`, then {@link YearWeek._ofWeekBasedYear} is executed;\n * - otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {Year|number} year - the year to represent, not null\n * @param {number} week - the week-of-week-based-year to represent, from 1 to 53\n * @return {YearWeek} the year-week, not null\n */\n static of(year, week) {\n MathUtil.verifyInt(week);\n if (year instanceof Year) {\n return this._ofYearWeek(year, week);\n } else {\n MathUtil.verifyInt(year);\n return this._ofWeekBasedYear(year, week);\n }\n }\n\n /**\n * Obtains an instance of {@link YearWeek} from a year and week.\n * \n * If the week is 53 and the year does not have 53 weeks, week one of the following\n * year is selected.\n * \n * Note that this class is based on the week-based-year which aligns to Monday to Sunday weeks,\n * whereas {@link Year} is intended to represent standard years aligned from January to December.\n * This difference may be seen at the start and/or end of the year.\n * This method treats the standard year as though it is the week-based-year.\n * Thus, `YearWeek.of(Year.of(2020), 1)` creates an object where Monday and Tuesday of the week\n * are actually the last two days of 2019.\n *\n * @param {Year} year - the year to represent, not null\n * @param {number} week - the week-of-week-based-year to represent, from 1 to 53\n * @return {YearWeek} the year-week, not null\n * @throws {DateTimeException} if the week value is invalid\n * @protected\n */\n static _ofYearWeek(year, week) {\n const weekBasedYear = year.value();\n return this._ofWeekBasedYear(weekBasedYear, week);\n }\n\n /**\n * Obtains an instance of {@link YearWeek} from a week-based-year and week.\n * \n * If the week is 53 and the year does not have 53 weeks, week one of the following\n * year is selected.\n *\n * @param {number} weekBasedYear - the week-based-year to represent, from MIN_YEAR to MAX_YEAR\n * @param {number} week - the week-of-week-based-year to represent, from 1 to 53\n * @return {YearWeek} the year-week, not null\n * @throws {DateTimeException} if either field is invalid\n * @protected\n */\n static _ofWeekBasedYear(weekBasedYear, week) {\n IsoFields.WEEK_BASED_YEAR.range().checkValidValue(weekBasedYear, IsoFields.WEEK_BASED_YEAR);\n IsoFields.WEEK_OF_WEEK_BASED_YEAR.range().checkValidValue(week, IsoFields.WEEK_OF_WEEK_BASED_YEAR);\n if (week === 53 && YearWeek._weekRange(weekBasedYear) < 53) {\n week = 1;\n weekBasedYear++;\n IsoFields.WEEK_BASED_YEAR.range().checkValidValue(weekBasedYear, IsoFields.WEEK_BASED_YEAR);\n }\n return new YearWeek(weekBasedYear, week);\n }\n\n /**\n * from IsoFields in ThreeTen-Backport\n * @private\n */\n static _weekRange(weekBasedYear) {\n const date = LocalDate.of(weekBasedYear, 1, 1);\n // 53 weeks if year starts on Thursday, or Wed in a leap year\n if (date.dayOfWeek() === DayOfWeek.THURSDAY || (date.dayOfWeek() === DayOfWeek.WEDNESDAY && date.isLeapYear())) {\n return 53;\n }\n return 52;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link YearWeek} from a temporal object.\n * \n * This obtains a year-week based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link YearWeek}.\n * \n * The conversion extracts the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link YearWeek.FROM}.\n *\n * @param {Temporal} temporal - the temporal object to convert, not null\n * @return {YearWeek} the year-week, not null\n * @throws {DateTimeException} if unable to convert to a {@link YearWeek}\n */\n static from(temporal) {\n if (temporal instanceof YearWeek) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (!IsoChronology.INSTANCE.equals(Chronology.from(temporal))) {\n temporal = LocalDate.from(temporal);\n }*/\n // need to use getLong() as JDK Parsed class get() doesn't work properly\n const year = MathUtil.safeToInt(temporal.getLong(IsoFields.WEEK_BASED_YEAR));\n const week = MathUtil.safeToInt(temporal.getLong(IsoFields.WEEK_OF_WEEK_BASED_YEAR));\n return YearWeek.of(year, week);\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain YearWeek from TemporalAccessor: ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link YearWeek} from a text string using a specific formatter.\n * \n * The text is parsed using the formatter, returning a year-week.\n *\n * @param {string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=YearWeek.PARSER] - the formatter to use, default is\n * {@link YearWeek.PARSER}\n * \n * @return {YearWeek} the parsed year-week, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = YearWeek.PARSER) {\n assert(formatter != null, 'formatter', NullPointerException);\n return formatter.parse(text, YearWeek.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {number} weekBasedYear - the week-based-year to represent, validated from MIN_YEAR to MAX_YEAR\n * @param {number} week - the week to represent, validated\n * @private\n */\n constructor(weekBasedYear, week) {\n super();\n this._year = weekBasedYear;\n this._week = week;\n }\n\n /**\n * function overloading for {@link YearWeek.isSupported}\n * - if called with an instance of {@link TemporalField}, then {@link YearWeek._isSupportedField} is executed,\n * - if called with an instance of {@link TemporalUnit}, then {@link YearWeek._isSupportedUnit} is executed,\n * - otherwise {@link IllegalArgumentException} is thrown.\n *\n * @param {TemporalField|TemporalUnit} fieldOrUnit\n * @return {boolean}\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof TemporalField) {\n return this._isSupportedField(fieldOrUnit);\n }\n if (fieldOrUnit instanceof TemporalUnit) {\n return this._isSupportedUnit(fieldOrUnit);\n }\n if (fieldOrUnit == null) {\n return false;\n }\n throw new IllegalArgumentException(`fieldOrUnit must be an instance of TemporalField or TemporalUnit, but is ${fieldOrUnit.constructor.name}`);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this year-week can be queried for the specified field.\n * If false, then calling the {@link YearWeek.range} range and\n * {@link YearWeek.get} get methods will throw an exception.\n * \n * The supported fields are:\n * <ul>\n * <li>{@link IsoFields.WEEK_OF_WEEK_BASED_YEAR}\n * <li>{@link IsoFields.WEEK_BASED_YEAR}\n * </ul>\n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param {TemporalField} field - the field to check, null returns false\n * @return {boolean} true if the field is supported on this year-week, false if not\n * @protected\n */\n _isSupportedField(field) {\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR || field === IsoFields.WEEK_BASED_YEAR) {\n return true;\n } else if (field instanceof ChronoField) {\n return false;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n * \n * This checks if the specified unit can be added to, or subtracted from, this date-time.\n * If false, then calling the {@link YearWeek.plus} and\n * {@link YearWeek.minus} minus methods will throw an exception.\n * \n * The supported units are:\n * - {@link ChronoUnit.WEEKS}\n * - {@link IsoFields.WEEK_BASED_YEARS}\n * \n * All other {@link ChronoUnit} instances will return false.\n * \n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.isSupportedBy}\n * passing this as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param {TemporalUnit} unit - the unit to check, null returns false\n * @return {boolean} true if the unit can be added/subtracted, false if not\n * @protected\n */\n _isSupportedUnit(unit) {\n if (unit === ChronoUnit.WEEKS || unit === IsoFields.WEEK_BASED_YEARS) {\n return true;\n } else if (unit instanceof ChronoUnit) {\n return false;\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This year-week is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * The range for the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields is returned.\n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * @param {TemporalField} field - the field to query the range for, not null\n * @return {ValueRange} the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.WEEK_BASED_YEAR) {\n return IsoFields.WEEK_BASED_YEAR.range();\n }\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR) {\n return ValueRange.of(1, YearWeek._weekRange(this._year));\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this year-week as an `int`.\n * \n * This queries this year-week for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * The value for the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields is returned.\n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this year-week as a `long`.\n * \n * This queries this year-week for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * The value for the {@link IsoFields.WEEK_BASED_YEAR} WEEK_BASED_YEAR and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} WEEK_OF_WEEK_BASED_YEAR fields is returned.\n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n *\n * @param {TemporalField} field - the field to get, not null\n * @return {number} the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === IsoFields.WEEK_BASED_YEAR) {\n return this._year;\n }\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR) {\n return this._week;\n }\n if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the week-based-year field.\n * \n * This method returns the primitive `int` value for the week-based-year.\n * \n * Note that the ISO week-based-year does not align with the standard Gregorian/ISO calendar year.\n *\n * @return {number} the week-based-year\n */\n year() {\n return this._year;\n }\n\n /**\n * Gets the week-of-week-based-year field.\n * \n * This method returns the primitive `int` value for the week of the week-based-year.\n *\n * @return {number} the week-of-week-based-year\n */\n week() {\n return this._week;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the week-based-year has 53 weeks.\n * \n * This determines if the year has 53 weeks, returning true.\n * If false, the year has 52 weeks.\n *\n * @return {boolean} true if the year has 53 weeks, false otherwise\n */\n is53WeekYear() {\n return YearWeek._weekRange(this._year) === 53;\n }\n\n /**\n * Returns the length of the week-based-year.\n * \n * This returns the length of the year in days, either 364 or 371.\n *\n * @return {number} 364 if the year has 52 weeks, 371 if it has 53 weeks\n */\n lengthOfYear() {\n return (this.is53WeekYear() ? 371 : 364);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this year-week.\n * \n * This returns a {@link YearWeek}, based on this one, with the year-week adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalAdjusteradjustInto} method on the\n * specified adjuster passing this as the argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} adjuster - adjuster the adjuster to use, not null\n * @return {YearWeek} a year-week based on this with the adjustment made, not null\n * @throws {DateTimeException} if the adjustment cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof YearWeek) {\n return adjuster;\n }\n return super._withAdjuster(adjuster);\n }\n\n /**\n * Returns a copy of this year-week with the specified field set to a new value.\n * \n * This returns a {@link YearWeek}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the year or week.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n * - {@link WEEK_OF_WEEK_BASED_YEAR} - Returns a {@link YearWeek} with the specified week-of-year set as per {@link YearWeek.withWeek}.\n * - {@link WEEK_BASED_YEAR} - Returns a {@link YearWeek} with the specified year set as per {@link YearWeek.withYear}.\n * \n * All {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.adjustInto}\n * passing this as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalField} field - the field to set in the result, not null\n * @param {number} newValue - the new value of the field in the result\n * @return {YearWeek} a year-week based on this with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _withField(field, newValue) {\n if (field === IsoFields.WEEK_OF_WEEK_BASED_YEAR) {\n return this.withWeek(IsoFields.WEEK_OF_WEEK_BASED_YEAR.range().checkValidIntValue(newValue, IsoFields.WEEK_OF_WEEK_BASED_YEAR));\n } else if (field === IsoFields.WEEK_BASED_YEAR) {\n return this.withYear(IsoFields.WEEK_BASED_YEAR.range().checkValidIntValue(newValue, IsoFields.WEEK_BASED_YEAR));\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * Returns a copy of this {@link YearWeek} with the week-based-year altered.\n * \n * This returns a year-week with the specified week-based-year.\n * If the week of this instance is 53 and the new year does not have 53 weeks,\n * the week will be adjusted to be 52.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} weekBasedYear - the week-based-year to set in the returned year-week\n * @return {YearWeek} a year-week based on this year-week with the requested year, not null\n * @throws {DateTimeException} if the week-based-year value is invalid\n */\n withYear(weekBasedYear) {\n if (this._week === 53 && YearWeek._weekRange(weekBasedYear) < 53) {\n return YearWeek.of(weekBasedYear, 52);\n }\n return YearWeek.of(weekBasedYear, this._week);\n }\n\n /**\n * Returns a copy of this {@link YearWeek} with the week altered.\n * \n * This returns a year-week with the specified week-of-week-based-year.\n * If the new week is 53 and the year does not have 53 weeks, week one of the\n * following year is selected.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} week - the week-of-week-based-year to set in the returned year-week\n * @return {YearWeek} a year-week based on this year-week with the requested week, not null\n * @throws {DateTimeException} if the week-of-week-based-year value is invalid\n */\n withWeek(week) {\n return YearWeek.of(this._year, week);\n }\n\n /**\n * Returns a copy of this year-week with the specified amount added.\n * \n * This returns a {@link YearWeek}, based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoUnit} then the addition is implemented here.\n * The supported fields behave as follows:\n * - {@link WEEKS} - Returns a {@link YearWeek} with the weeks added as per {@link YearWeek.plusWeeks}.\n * - {@link WEEK_BASED_YEARS} - Returns a {@link YearWeek} with the years added as per {@link YearWeek.plusYears}.\n * \n * All {@link ChronoUnit} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.addTo}\n * passing this as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToAdd - the amount of the unit to add to the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to add, not null\n * @return {YearWeek} a year-week based on this year-week with the specified amount added, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _plusUnit(amountToAdd, unit) {\n if (unit === ChronoUnit.WEEKS) {\n return this.plusWeeks(amountToAdd);\n } else if (unit === IsoFields.WEEK_BASED_YEARS) {\n return this.plusYears(amountToAdd);\n } else if (unit instanceof ChronoUnit) {\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of years added.\n * \n * If the week of this instance is 53 and the new year does not have 53 weeks,\n * the week will be adjusted to be 52.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} yearsToAdd - the years to add, may be negative\n * @return {YearWeek} the year-week with the years added, not null\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n const newYear = MathUtil.safeToInt(MathUtil.safeAdd(this._year, yearsToAdd));\n return this.withYear(newYear);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of weeks added.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} weeksToAdd - the weeks to add, may be negative\n * @return {YearWeek} the year-week with the weeks added, not null\n */\n plusWeeks(weeksToAdd) {\n if (weeksToAdd === 0) {\n return this;\n }\n const mondayOfWeek = this.atDay(DayOfWeek.MONDAY).plusWeeks(weeksToAdd);\n return YearWeek.from(mondayOfWeek);\n }\n\n /**\n * Returns a copy of this year-week with the specified amount subtracted.\n * \n * This returns a {@link YearWeek}, based on this one, with the amount\n * in terms of the unit subtracted. If it is not possible to subtract the amount,\n * because the unit is not supported or for some other reason, an exception is thrown.\n * \n * This method is equivalent to {@link YearWeek.plus} with the amount negated.\n * See that method for a full description of how addition, and thus subtraction, works.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} amountToSubtract - the amount of the unit to subtract from the result, may be negative\n * @param {TemporalUnit} unit - the unit of the amount to subtract, not null\n * @return {YearWeek} a year-week based on this year-week with the specified amount subtracted, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n _minusUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n return this._plusUnit(-amountToSubtract, unit);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of years subtracted.\n * \n * If the week of this instance is 53 and the new year does not have 53 weeks,\n * the week will be adjusted to be 52.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} yearsToSubtract - the years to subtract, may be negative\n * @return {YearWeek} the year-week with the years subtracted, not null\n */\n minusYears(yearsToSubtract) {\n if (yearsToSubtract === 0) {\n return this;\n }\n const newYear = MathUtil.safeToInt(MathUtil.safeSubtract(this._year, yearsToSubtract));\n return this.withYear(newYear);\n }\n\n /**\n * Returns a copy of this year-week with the specified number of weeks subtracted.\n * \n * This instance is immutable and unaffected by this method call.\n * \n * @param {number} weeksToSubtract - the weeks to subtract, may be negative\n * @return {YearWeek} the year-week with the weeks subtracted, not null\n */\n minusWeeks(weeksToSubtract) {\n if (weeksToSubtract === 0) {\n return this;\n }\n const mondayOfWeek = this.atDay(DayOfWeek.MONDAY).minusWeeks(weeksToSubtract);\n return YearWeek.from(mondayOfWeek);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year-week using the specified query.\n * \n * This queries this year-week using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param {TemporalQuery} query - the query to invoke, not null\n * @return {*} the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this year-week.\n * \n * This returns a temporal object of the same observable type as the input\n * with the week-based-year and week changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * twice, passing {@link IsoFields.WEEK_BASED_YEAR} and\n * {@link IsoFields.WEEK_OF_WEEK_BASED_YEAR} as the fields.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisYearWeek.adjustInto(temporal);\n * temporal = temporal.with(thisYearWeek);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the target object to be adjusted, not null\n * @return {Temporal} the adjusted object, not null\n * @throws {DateTimeException} if unable to make the adjustment\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n adjustInto(temporal) {\n return temporal.with(IsoFields.WEEK_BASED_YEAR, this._year).with(IsoFields.WEEK_OF_WEEK_BASED_YEAR, this._week);\n }\n\n /**\n * Calculates the amount of time until another year-week in terms of the specified unit.\n * \n * This calculates the amount of time between two {@link YearWeek}\n * objects in terms of a single {@link TemporalUnit}.\n * The start and end points are this and the specified year-week.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method is converted to a\n * {@link YearWeek} using {@link YearWeek.from}.\n * For example, the period in years between two year-weeks can be calculated\n * using `startYearWeek.until(endYearWeek, YEARS)`.\n * \n * The calculation returns a whole number, representing the number of\n * complete units between the two year-weeks.\n * For example, the period in years between 2012-W23 and 2032-W22\n * will only be 9 years as it is one week short of 10 years.\n * \n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit.between}:\n * ```\n * // these two lines are equivalent\n * amount = start.until(end, WEEKS);\n * amount = WEEKS.between(start, end);\n * ```\n * The choice should be made based on which makes the code more readable.\n * \n * The calculation is implemented in this method for units {@link WEEKS}\n * and {@link WEEK_BASED_YEARS}.\n * Other {@link ChronoUnit} values will throw an exception.\n * \n * If the unit is not a {@link ChronoUnit}, then the result of this method\n * is obtained by invoking {@link TemporalUnit.between}\n * passing this as the first argument and the converted input temporal\n * as the second argument.\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date, exclusive, which is converted to a {@link YearWeek}, not null\n * @param {TemporalUnit} unit - the unit to measure the amount in, not null\n * @return {number} the amount of time between this year-week and the end year-week\n * @throws {DateTimeException} if the amount cannot be calculated, or the end\n * temporal cannot be converted to a {@link YearWeek}\n * @throws {UnsupportedTemporalTypeException} if the unit is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n const end = YearWeek.from(endExclusive);\n if (unit === ChronoUnit.WEEKS) {\n return this._daysUntil(end);\n } else if (unit === IsoFields.WEEK_BASED_YEARS) {\n return this._yearsUntil(end);\n } else if (unit instanceof ChronoUnit) {\n throw new UnsupportedTemporalTypeException(`Unsupported unit: ${unit}`);\n }\n return unit.between(this, end);\n }\n\n /**\n * @private\n */\n _daysUntil(end) {\n const startDate = this.atDay(DayOfWeek.MONDAY);\n const endDate = end.atDay(DayOfWeek.MONDAY);\n const days = endDate.toEpochDay() - startDate.toEpochDay();\n return MathUtil.intDiv(days, 7);\n }\n\n /**\n * @private\n */\n _yearsUntil(end) {\n const yearsDiff = end._year - this._year;\n if (yearsDiff > 0 && end._week < this._week) {\n return yearsDiff - 1;\n }\n if (yearsDiff < 0 && end._week > this._week) {\n return yearsDiff + 1;\n }\n return yearsDiff;\n }\n\n /**\n * Formats this year-week using the specified formatter.\n * \n * This year-week will be passed to the formatter to produce a string.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted year-week string, not null\n * @throws {DateTimeException} if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year-week with a day-of-week to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this year-week and the specified day-of-Week.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = yearWeek.atDay(MONDAY);\n * ```\n *\n * @param {DayOfWeek} dayOfWeek - the day-of-week to use, not null\n * @return {LocalDate} the date formed from this year-week and the specified day, not null\n */\n atDay(dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n const correction = LocalDate.of(this._year, 1, 4).dayOfWeek().value() + 3;\n const dayOfYear = this._week * 7 + dayOfWeek.value() - correction;\n const maxDaysOfYear = Year.isLeap(this._year) ? 366 : 365;\n if (dayOfYear > maxDaysOfYear) {\n return LocalDate.ofYearDay(this._year + 1, dayOfYear - maxDaysOfYear);\n }\n if (dayOfYear > 0) {\n return LocalDate.ofYearDay(this._year, dayOfYear);\n } else {\n const daysOfPreviousYear = Year.isLeap(this._year - 1) ? 366 : 365;\n return LocalDate.ofYearDay(this._year - 1, daysOfPreviousYear + dayOfYear);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this year-week to another\n * \n * The comparison is based first on the value of the year, then on the value of the week.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {YearWeek} other - the other year-week to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, YearWeek, 'other');\n let cmp = (this._year - other._year);\n if (cmp === 0) {\n cmp = (this._week - other._week);\n }\n return cmp;\n }\n \n /**\n * Is this year-week after the specified year-week.\n *\n * @param {YearWeek} other - the other year-week to compare to, not null\n * @return {boolean} true if this is after the specified year-week\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this year-week before the specified year-week.\n *\n * @param {YearWeek} other - the other year-week to compare to, not null\n * @return {boolean} true if this point is before the specified year-week\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n \n //-----------------------------------------------------------------------\n /**\n * Checks if this year-week is equal to another year-week.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other year-week\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof YearWeek) {\n return this._year === obj._year && this._week === obj._week;\n }\n return false;\n }\n \n /**\n * A hash code for this year-week.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._year ^ (this._week << 25);\n }\n \n //-----------------------------------------------------------------------\n /**\n * Outputs this year-week as a {@link String}, such as `2015-W13`.\n * \n * The output will be in the format `YYYY-'W'ww`:\n *\n * @return {string} a string representation of this year-week, not null\n */\n toString() {\n let yearString;\n const yearValue = this._year;\n const absYear = Math.abs(yearValue);\n if (absYear < 1000) {\n if (yearValue < 0) {\n yearString = `-${(`${yearValue - 10000}`).slice(-4)}`;\n } else {\n yearString = (`${yearValue + 10000}`).slice(-4);\n }\n } else {\n if (yearValue > 9999) {\n yearString = `+${yearValue}`;\n } else {\n yearString = `${yearValue}`;\n }\n }\n return yearString.concat(this._week < 10 ? '-W0' : '-W').concat(this._week);\n }\n}\n\nexport function _init() {\n YearWeek.PARSER = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .appendValue(IsoFields.WEEK_BASED_YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-W')\n .appendValue(IsoFields.WEEK_OF_WEEK_BASED_YEAR, 2)\n .toFormatter();\n\n YearWeek.FROM = createTemporalQuery('YearWeek.FROM', (temporal) => {\n return YearWeek.from(temporal);\n });\n}\n\n// copied from packages/core/src/temporal/TemporalQuery.js\nfunction createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n }\n\n ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;\n return new ExtendedTemporalQuery(name);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as dayOfMonthInit } from './DayOfMonth';\nimport { _init as dayOfYearInit } from './DayOfYear';\nimport { _init as intervalInit } from './Interval';\nimport { _init as localDateRangeInit } from './LocalDateRange';\nimport { _init as offsetDateInit } from './OffsetDate';\nimport { _init as quarterInit } from './Quarter';\nimport { _init as temporalsInit } from './Temporals';\nimport { _init as yearQuarterInit } from './YearQuarter';\nimport { _init as yearWeekInit } from './YearWeek';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n dayOfMonthInit();\n dayOfYearInit();\n intervalInit();\n localDateRangeInit();\n offsetDateInit();\n quarterInit();\n temporalsInit();\n yearQuarterInit();\n yearWeekInit();\n}\n\ninit();\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { DayOfMonth } from './DayOfMonth';\n// import { DayOfYear } from './DayOfYear';\n// import { Interval } from './Interval';\n// import { LocalDateRange } from './LocalDateRange';\n// import { OffsetDate } from './OffsetDate';\n// import { Quarter } from './Quarter';\n// import { Temporals } from './Temporals';\n// import { YearQuarter } from './YearQuarter';\n// import { YearWeek } from './YearWeek';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.DayOfMonth = DayOfMonth;\n // jsJoda.DayOfYear = DayOfYear;\n // jsJoda.Interval = Interval;\n // jsJoda.LocalDateRange = LocalDateRange;\n // jsJoda.OffsetDate = OffsetDate;\n // jsJoda.Quarter = Quarter;\n // jsJoda.Temporals = Temporals;\n // jsJoda.YearQuarter = YearQuarter;\n // jsJoda.YearWeek = YearWeek;\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { DayOfMonth } from './DayOfMonth';\nimport { DayOfYear } from './DayOfYear';\nimport { Interval } from './Interval';\nimport { LocalDateRange } from './LocalDateRange';\nimport { OffsetDate } from './OffsetDate';\nimport { Quarter } from './Quarter';\nimport { Temporals } from './Temporals';\nimport { YearQuarter } from './YearQuarter';\nimport { YearWeek } from './YearWeek';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n DayOfMonth,\n DayOfYear,\n Interval,\n LocalDateRange,\n OffsetDate,\n Quarter,\n Temporals,\n YearQuarter,\n YearWeek,\n};\n"],"names":["assert","assertion","msg","error","Error","requireNonNull","value","parameterName","NullPointerException","requireInstance","_class","IllegalArgumentException","name","constructor","MathUtil","jodaInternal","DayOfMonth","now","zoneIdOrClock","arguments","length","_now0","ZoneId","_nowZoneId","Clock","_nowClock","systemDefaultZone","zone","system","clock","LocalDate","of","dayOfMonth","VALUES","DateTimeException","from","temporal","get","ChronoField","DAY_OF_MONTH","ex","_day","safeToInt","isSupported","field","isSupportedBy","range","checkValidIntValue","getLong","UnsupportedTemporalTypeException","getFrom","isValidYearMonth","yearMonth","isValidDay","query","TemporalQuery","TemporalQueries","chronology","IsoChronology","INSTANCE","adjustInto","with","atMonth","month","Month","MonthDay","Math","min","maxLength","atYearMonth","atDay","lengthOfMonth","compareTo","other","equals","obj","hashCode","toString","TemporalAccessor","_init","Array","i","DayOfYear","dayOfYear","DAY_OF_YEAR","isValidYear","year","Year","isLeap","atYear","ofYearDay","Interval","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","Instant","isBefore","duration","isNegative","plus","parse","text","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","encloses","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","ALL","MINP1","plusDays","MAXM1","minusDays","LocalDateRange","endExclusiveOrPeriod","_ofLocalDateLocalDate","Period","_ofLocalDatePeriod","messageParts","push","join","period","ofClosed","endInclusive","ofEmpty","date","ofUnbounded","ofUnboundedStart","ofUnboundedEnd","slice","adjuster","localDateOrLocalDateRange","_isAfterLocalDate","_isAfterLocalDateRange","_isBeforeLocalDate","_isBeforeLocalDateRange","lengthInDays","Number","POSITIVE_INFINITY","toEpochDay","toPeriod","ArithmeticException","SECONDS_PER_DAY","OffsetDate","ofInstant","rules","offset","_ofLocalDateZoneOffset","_ofIntIntIntZoneOffset","d","epochSec","epochSecond","totalSeconds","epochDay","floorDiv","ofEpochDay","ZoneOffset","formatter","DateTimeFormatter","ISO_OFFSET_DATE","FROM","_date","_offset","_with","fieldOrUnit","TemporalField","_isSupportedField","TemporalUnit","_isSupportedUnit","isDateBased","OFFSET_SECONDS","unit","ChronoUnit","rangeRefinedBy","withOffsetSameLocal","toLocalDate","monthValue","dayOfWeek","_withAdjuster","_withField","newValue","f","ofTotalSeconds","withYear","withMonth","withDayOfMonth","withDayOfYear","_plusUnit","amountToAdd","addTo","plusYears","years","plusMonths","months","plusWeeks","weeks","days","minusYears","minusMonths","minusWeeks","precision","DAYS","EPOCH_DAY","until","offsetDiff","endLocal","intDiv","format","atTime","time","OffsetDateTime","_toEpochSecond","secs","toEpochSecond","toSecondOfDay","compare","isEqual","Temporal","createTemporalQuery","queryFromFunction","ExtendedTemporalQuery","prototype","queryFrom","Quarter","valueOf","Q1","Q2","Q3","Q4","values","QUARTERS","quarterOfYear","ofMonth","monthOfYear","MONTH_OF_YEAR","checkValidValue","ordinal","qoy","IsoFields","QUARTER_OF_YEAR","_value","_name","displayName","style","locale","quarters","amount","intMod","leapYear","firstMonth","JANUARY","APRIL","JULY","OCTOBER","IllegalStateException","QUARTER_YEARS","Temporals","nextWorkingDay","Adjuster","NEXT_WORKING","nextWorkingDayOrSame","NEXT_WORKING_OR_SAME","previousWorkingDay","PREVIOUS_WORKING","previousWorkingDayOrSame","PREVIOUS_WORKING_OR_SAME","parseFirstMatching","formatters","pp","ParsePosition","parseUnresolved","len","getErrorIndex","getIndex","ignored","convertAmount","fromUnit","toUnit","_validateUnit","_isPrecise","fromNanos","toNanos","multiple","safeMultiply","fromMonthFactor","_monthMonthFactor","toMonthFactor","ERAS","FOREVER","WEEKS","MONTHS","YEARS","DECADES","CENTURIES","MILLENNIA","dow","DAY_OF_WEEK","TemporalAdjuster","YearQuarter","getYear","getMonth","quarter","_ofYearQuarter","_ofYearInt","_ofIntQuarter","_ofIntInt","yearMessage","quarterMessage","YEAR","PARSER","_year","_quarter","newYear","newQuarter","YEAR_OF_ERA","ERA","ValueRange","MAX_VALUE","_prolepticQuarter","quarterValue","isLeapYear","dayOfQuarter","lengthOfQuarter","lengthOfYear","withQuarter","plusQuarters","safeAdd","yearsToAdd","quartersToAdd","quarterCount","calcQuarters","floorMod","yearsToSubtract","MIN_SAFE_INTEGER","minusQuarters","quartersToSubtract","newProlepticQuarter","oldProlepticQuarter","quartersUntil","DAY_OF_QUARTER","leap","atEndOfQuarter","cmp","yearString","yearValue","absYear","abs","concat","DateTimeFormatterBuilder","parseCaseInsensitive","appendValue","SignStyle","EXCEEDS_PAD","appendLiteral","toFormatter","YearWeek","WEEK_BASED_YEAR","WEEK_OF_WEEK_BASED_YEAR","week","verifyInt","_ofYearWeek","_ofWeekBasedYear","weekBasedYear","_weekRange","DayOfWeek","THURSDAY","WEDNESDAY","_week","WEEK_BASED_YEARS","is53WeekYear","withWeek","weeksToAdd","mondayOfWeek","MONDAY","_minusUnit","amountToSubtract","safeSubtract","weeksToSubtract","_daysUntil","_yearsUntil","startDate","endDate","yearsDiff","correction","maxDaysOfYear","daysOfPreviousYear","isInit","init","dayOfMonthInit","dayOfYearInit","intervalInit","localDateRangeInit","offsetDateInit","quarterInit","temporalsInit","year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