{"version":3,"file":"js-joda.js","sources":["../src/errors.js","../src/assert.js","../src/MathUtil.js","../src/Enum.js","../src/temporal/TemporalAmount.js","../src/temporal/TemporalUnit.js","../src/Duration.js","../src/YearConstants.js","../src/temporal/ChronoUnit.js","../src/temporal/TemporalField.js","../src/temporal/ValueRange.js","../src/temporal/ChronoField.js","../src/temporal/TemporalQueries.js","../src/temporal/TemporalAccessor.js","../src/temporal/Temporal.js","../src/temporal/TemporalQuery.js","../src/DayOfWeek.js","../src/StringUtil.js","../src/ZoneId.js","../src/zone/ZoneRules.js","../src/ZoneOffset.js","../src/Period.js","../src/format/ParsePosition.js","../src/format/EnumMap.js","../src/format/ResolverStyle.js","../src/format/DateTimeBuilder.js","../src/format/DateTimeParseContext.js","../src/format/DateTimePrintContext.js","../src/format/SignStyle.js","../src/format/StringBuilder.js","../src/format/DateTimeFormatter.js","../src/chrono/ChronoLocalDate.js","../src/temporal/IsoFields.js","../src/format/DecimalStyle.js","../src/format/TextStyle.js","../src/format/parser/CharLiteralPrinterParser.js","../src/format/parser/CompositePrinterParser.js","../src/format/parser/FractionPrinterParser.js","../src/format/parser/NumberPrinterParser.js","../src/format/parser/OffsetIdPrinterParser.js","../src/format/parser/PadPrinterParserDecorator.js","../src/format/parser/SettingsParser.js","../src/format/parser/StringLiteralPrinterParser.js","../src/zone/ZoneRulesProvider.js","../src/ZoneRegion.js","../src/format/parser/ZoneIdPrinterParser.js","../src/format/DateTimeFormatterBuilder.js","../src/Month.js","../src/MonthDay.js","../src/YearMonth.js","../src/Year.js","../src/temporal/TemporalAdjuster.js","../src/temporal/TemporalAdjusters.js","../src/chrono/IsoChronology.js","../src/chrono/ChronoZonedDateTime.js","../src/ZonedDateTime.js","../src/LocalDate.js","../src/chrono/ChronoLocalDateTime.js","../src/LocalDateTime.js","../src/LocalTime.js","../src/Instant.js","../src/Clock.js","../src/zone/ZoneOffsetTransition.js","../src/temporal/TemporalQueriesFactory.js","../src/zone/SystemDefaultZoneRules.js","../src/zone/SystemDefaultZoneId.js","../src/ZoneIdFactory.js","../src/_init.js","../src/convert.js","../src/temporal/NativeJsTemporal.js","../src/use.js","../src/js-joda.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 */\n\nfunction createErrorType(name, init, superErrorClass = Error) {\n function E(message) {\n if (!Error.captureStackTrace){\n this.stack = (new Error()).stack;\n } else {\n Error.captureStackTrace(this, this.constructor);\n }\n this.message = message;\n init && init.apply(this, arguments);\n this.toString = function () {\n return `${this.name}: ${this.message}`;\n };\n }\n E.prototype = new superErrorClass();\n E.prototype.name = name;\n E.prototype.constructor = E;\n return E;\n}\n\nexport const DateTimeException = createErrorType('DateTimeException', messageWithCause);\nexport const DateTimeParseException = createErrorType('DateTimeParseException', messageForDateTimeParseException);\nexport const UnsupportedTemporalTypeException = createErrorType('UnsupportedTemporalTypeException', null, DateTimeException);\nexport const ArithmeticException = createErrorType('ArithmeticException');\nexport const IllegalArgumentException = createErrorType('IllegalArgumentException');\nexport const IllegalStateException = createErrorType('IllegalStateException');\nexport const NullPointerException = createErrorType('NullPointerException');\n\nfunction messageWithCause(message, cause = null) {\n let msg = message || this.name;\n if (cause !== null && cause instanceof Error) {\n msg += '\\n-------\\nCaused by: ' + cause.stack + '\\n-------\\n';\n }\n this.message = msg;\n}\n\nfunction messageForDateTimeParseException(message, text = '', index = 0, cause = null) {\n let msg = message || this.name;\n msg += ': ' + text + ', at index: ' + index;\n if (cause !== null && cause instanceof Error) {\n msg += '\\n-------\\nCaused by: ' + cause.stack + '\\n-------\\n';\n }\n this.message = msg;\n this.parsedString = () => {\n return text;\n };\n this.errorIndex = () => {\n return index;\n };\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 */\nimport {NullPointerException, IllegalArgumentException} from './errors';\n\nexport function assert(assertion, msg, error) {\n if(!assertion){\n if (error) {\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\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\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\nexport function abstractMethodFail(methodName){\n throw new TypeError('abstract method \"' + methodName + '\" is not implemented');\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 */\nimport {ArithmeticException} from './errors';\n\nexport const MAX_SAFE_INTEGER = 9007199254740991;\nexport const MIN_SAFE_INTEGER = -9007199254740991;\n\n/**\n * Math helper with static function for integer operations\n */\nexport class MathUtil {\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static intDiv(x, y) {\n let r = x/y;\n r = MathUtil.roundDown(r);\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static intMod(x, y) {\n let r = x - MathUtil.intDiv(x, y) * y;\n r = MathUtil.roundDown(r);\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} r\n * @returns {number}\n */\n static roundDown(r){\n if (r < 0) {\n return Math.ceil(r);\n } else {\n return Math.floor(r);\n }\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static floorDiv(x, y){\n const r = Math.floor(x / y);\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static floorMod(x, y){\n const r = x - MathUtil.floorDiv(x, y) * y;\n return MathUtil.safeZero(r);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static safeAdd(x, y) {\n MathUtil.verifyInt(x);\n MathUtil.verifyInt(y);\n if (x === 0) {\n return MathUtil.safeZero(y);\n }\n if (y === 0) {\n return MathUtil.safeZero(x);\n }\n const r = MathUtil.safeToInt(x + y);\n if (r === x || r === y) {\n throw new ArithmeticException('Invalid addition beyond MAX_SAFE_INTEGER!');\n }\n return r;\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static safeSubtract(x, y) {\n MathUtil.verifyInt(x);\n MathUtil.verifyInt(y);\n if (x === 0 && y === 0) {\n return 0;\n } else if (x === 0) {\n return MathUtil.safeZero(-1 * y);\n } else if (y === 0) {\n return MathUtil.safeZero(x);\n }\n return MathUtil.safeToInt(x - y);\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n * @returns {number}\n */\n static safeMultiply(x, y) {\n MathUtil.verifyInt(x);\n MathUtil.verifyInt(y);\n if (x === 1) {\n return MathUtil.safeZero(y);\n }\n if (y === 1) {\n return MathUtil.safeZero(x);\n }\n if (x === 0 || y === 0) {\n return 0;\n }\n const r = MathUtil.safeToInt(x * y);\n if (r / y !== x || (x === MIN_SAFE_INTEGER && y === -1) || (y === MIN_SAFE_INTEGER && x === -1)) {\n throw new ArithmeticException('Multiplication overflows: ' + x + ' * ' + y);\n }\n return r;\n }\n\n /**\n *\n * @param {number} value\n * @returns {number}\n */\n static parseInt(value) {\n const r = parseInt(value);\n return MathUtil.safeToInt(r);\n }\n\n /**\n *\n * @param {number} value\n * @returns {number}\n */\n static safeToInt(value) {\n MathUtil.verifyInt(value);\n return MathUtil.safeZero(value);\n }\n\n /**\n *\n * @param {number} value\n */\n static verifyInt(value){\n if (value == null) {\n throw new ArithmeticException(`Invalid value: '${value}', using null or undefined as argument`);\n }\n if (isNaN(value)) {\n throw new ArithmeticException('Invalid int value, using NaN as argument');\n }\n if ((value % 1) !== 0) {\n throw new ArithmeticException(`Invalid value: '${value}' is a float`);\n }\n if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {\n throw new ArithmeticException('Calculation overflows an int: ' + value);\n }\n }\n\n /**\n * convert -0 to 0 and int as string to a number ( '1' -> 1 )\n *\n * @param {number} value\n * @returns {number}\n */\n static safeZero(value){\n return value === 0 ? 0 : +value;\n }\n\n /**\n * Compares two Numbers.\n *\n * @param {number} a the first value\n * @param {number} b the second value\n * @return {number} the result\n */\n static compareNumbers(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n\n // convert to small integer for v8 optimisation\n static smi(int) {\n return ((int >>> 1) & 0x40000000) | (int & 0xBFFFFFFF);\n }\n\n // calculate 32 bit hash of a number and convert to SMI\n static hash(number) {\n if (number !== number || number === Infinity) {\n return 0;\n }\n let result = number;\n while (number > 0xFFFFFFFF) {\n number /= 0xFFFFFFFF;\n result ^= number;\n }\n return MathUtil.smi(result);\n }\n\n // default hashCode calculation for a number sequence as mentioned by Joshua Bloch\n static hashCode(...numbers) {\n let result = 17;\n for (const n of numbers) {\n result = (result << 5) - result + MathUtil.hash(n);\n }\n return MathUtil.hash(result);\n }\n}\n\nMathUtil.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;\nMathUtil.MIN_SAFE_INTEGER = MIN_SAFE_INTEGER;\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/***\n * Base class for a pseudo enum\n */\nexport class Enum {\n constructor(name){\n this._name = name;\n }\n\n equals(other){\n return this === other;\n }\n\n toString() {\n return this._name;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\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 {abstractMethodFail} from '../assert';\n\n/**\n * Framework-level interface defining an amount of time, such as\n * \"6 hours\", \"8 days\" or \"2 years and 3 months\".\n *\n * This is the base interface type for amounts of time.\n * An amount is distinct from a date or time-of-day in that it is not tied\n * to any specific point on the time-line.\n *\n * The amount can be thought of as a {@link Map} of {@link TemporalUnit} to\n * `long`, exposed via {@link getUnits} and {@link get}.\n * A simple case might have a single unit-value pair, such as \"6 hours\".\n * A more complex case may have multiple unit-value pairs, such as\n * \"7 years, 3 months and 5 days\".\n *\n * There are two common implementations.\n * {@link Period} is a date-based implementation, storing years, months and days.\n * {@link Duration} is a time-based implementation, storing seconds and nanoseconds,\n * but providing some access using other duration based units such as minutes,\n * hours and fixed 24-hour days.\n *\n * This interface is a framework-level interface that should not be widely\n * used in application code. Instead, applications should create and pass\n * around instances of concrete types, such as {@link Period} and {@link Duration}.\n *\n * @interface\n */\nexport class TemporalAmount {\n /**\n * Returns the value of the requested unit.\n * The units returned from {@link getUnits} uniquely define the\n * value of the {@link TemporalAmount}. A value must be returned\n * for each unit listed in {@link getUnits}.\n *\n * @implSpec\n * Implementations may declare support for units not listed by {@link getUnits}.\n * Typically, the implementation would define additional units\n * as conversions for the convenience of developers.\n *\n * @param {TemporalUnit} unit - the {@link TemporalUnit} for which to return the value\n * @return {number} the long value of the unit\n * @throws DateTimeException if a value for the unit cannot be obtained\n * @throws UnsupportedTemporalTypeException if the {@link unit} is not supported\n */\n // eslint-disable-next-line no-unused-vars\n get(unit) {\n abstractMethodFail('get');\n }\n \n /**\n * Returns the list of units uniquely defining the value of this TemporalAmount.\n * The list of {@link TemporalUnits} is defined by the implementation class.\n * The list is a snapshot of the units at the time {@link getUnits}\n * is called and is not mutable.\n * The units are ordered from longest duration to the shortest duration\n * of the unit.\n *\n * @implSpec\n * The list of units completely and uniquely represents the\n * state of the object without omissions, overlaps or duplication.\n * The units are in order from longest duration to shortest.\n *\n * @return {TemporalUnit[]} the List of {@link TemporalUnits}; not null\n */\n units() {\n abstractMethodFail('units');\n }\n \n /**\n * Adds to the specified temporal object.\n *\n * Adds the amount to the specified temporal object using the logic\n * encapsulated in the implementing class.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#plus}:\n *
\n * // These two lines are equivalent, but the second approach is recommended\n * dateTime = amount.addTo(dateTime);\n * dateTime = dateTime.plus(adder);\n *\n * It is recommended to use the second approach, {@link plus},\n * as it is a lot clearer to read in code.\n *\n * @implSpec\n * The implementation must take the input object and add to it.\n * The implementation defines the logic of the addition and is responsible for\n * documenting that logic. It may use any method on {@link Temporal} to\n * query the temporal object and perform the addition.\n * The returned object must have the same observable type as the input object\n *\n * The input object must not be altered.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable temporal objects.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {Temporal} temporal - the temporal object to add the amount to, not null\n * @return {Temporal} an object of the same observable type with the addition made, not null\n * @throws DateTimeException if unable to add\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n addTo(temporal) {\n abstractMethodFail('addTo');\n }\n \n /**\n * Subtracts this object from the specified temporal object.\n *\n * Subtracts the amount from the specified temporal object using the logic\n * encapsulated in the implementing class.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#minus}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = amount.subtractFrom(dateTime);\n * dateTime = dateTime.minus(amount);\n *\n * It is recommended to use the second approach, {@link minus},\n * as it is a lot clearer to read in code.\n *\n * @implSpec\n * The implementation must take the input object and subtract from it.\n * The implementation defines the logic of the subtraction and is responsible for\n * documenting that logic. It may use any method on {@link Temporal} to\n * query the temporal object and perform the subtraction.\n * The returned object must have the same observable type as the input object\n *\n * The input object must not be altered.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable temporal objects.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {Temporal} temporal - the temporal object to subtract the amount from, not null\n * @return {Temporal} an object of the same observable type with the subtraction made, not null\n * @throws DateTimeException if unable to subtract\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n subtractFrom(temporal) {\n abstractMethodFail('subtractFrom');\n }\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 {abstractMethodFail} from '../assert';\n\n/**\n * A unit of date-time, such as Days or Hours.\n *\n * Measurement of time is built on units, such as years, months, days, hours, minutes and seconds.\n * Implementations of this interface represent those units.\n *\n * An instance of this interface represents the unit itself, rather than an amount of the unit.\n * See {@link Period} for a class that represents an amount in terms of the common units.\n *\n * The most commonly used units are defined in {@link ChronoUnit}.\n * Further units are supplied in {@link IsoFields}.\n * Units can also be written by application code by implementing this interface.\n *\n * The unit works using double dispatch. Client code calls methods on a date-time like\n * {@link LocalDateTime} which check if the unit is a {@link ChronoUnit}.\n * If it is, then the date-time must handle it.\n * Otherwise, the method call is re-dispatched to the matching method in this interface.\n *\n * @interface\n */\nexport class TemporalUnit {\n /**\n * Gets the duration of this unit, which may be an estimate.\n *\n * All units return a duration measured in standard nanoseconds from this method.\n * The duration will be positive and non-zero.\n * For example, an hour has a duration of `60 * 60 * 1,000,000,000ns`.\n *\n * Some units may return an accurate duration while others return an estimate.\n * For example, days have an estimated duration due to the possibility of\n * daylight saving time changes.\n * To determine if the duration is an estimate, use {@link isDurationEstimated}.\n *\n * @return {Duration} the duration of this unit, which may be an estimate, not null\n */\n duration() {\n abstractMethodFail('duration');\n }\n\n /**\n * Checks if the duration of the unit is an estimate.\n *\n * All units have a duration, however the duration is not always accurate.\n * For example, days have an estimated duration due to the possibility of\n * daylight saving time changes.\n * This method returns true if the duration is an estimate and false if it is\n * accurate. Note that accurate/estimated ignores leap seconds.\n *\n * @return {boolean} true if the duration is estimated, false if accurate\n */\n isDurationEstimated() {\n abstractMethodFail('isDurationEstimated');\n }\n\n /**\n * Checks if this unit is date-based.\n *\n * @return {boolean} true if date-based\n */\n isDateBased() {\n abstractMethodFail('isDateBased');\n }\n\n /**\n * Checks if this unit is time-based.\n *\n * @return {boolean} true if time-based\n */\n isTimeBased() {\n abstractMethodFail('isTimeBased');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this unit is supported by the specified temporal object.\n *\n * This checks that the implementing date-time can add/subtract this unit.\n * This can be used to avoid throwing an exception.\n *\n * @param {Temporal} temporal the temporal object to check, not null\n * @return {boolean} true if the unit is supported\n */\n // eslint-disable-next-line no-unused-vars\n isSupportedBy(temporal) {\n abstractMethodFail('isSupportedBy');\n }\n\n /**\n * Returns a copy of the specified temporal object with the specified period added.\n *\n * The period added is a multiple of this unit. For example, this method\n * could be used to add \"3 days\" to a date by calling this method on the\n * instance representing \"days\", passing the date and the period \"3\".\n * The period to be added may be negative, which is equivalent to subtraction.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#plus}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisUnit.doPlus(temporal);\n * temporal = temporal.plus(thisUnit);\n *\n * It is recommended to use the second approach, {@link plus},\n * as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the units\n * available in {@link ChronoUnit} or the fields available in {@link ChronoField}.\n * If the field is not supported a {@link DateTimeException} must be thrown.\n *\n * Implementations must not alter the specified temporal object.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {Temporal} dateTime the temporal object to adjust, not null\n * @param {number} periodToAdd the period of this unit to add, positive or negative\n * @return {Temporal} the adjusted temporal object, not null\n * @throws DateTimeException if the period cannot be added\n */\n // eslint-disable-next-line no-unused-vars\n addTo(dateTime, periodToAdd) {\n abstractMethodFail('addTo');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the period in terms of this unit between two temporal objects of the same type.\n *\n * This calculates the period between two temporals in terms of this unit.\n * The start and end points are supplied as temporal objects and must be of the same type.\n * The result will be negative if the end is before the start.\n * For example, the period in hours between two temporal objects can be calculated\n * using {@link HOURS.between}.\n *\n * The calculation returns a whole number, representing the number of complete units between the two temporals.\n * For example, the period in hours between the times 11:30 and 13:29 will only b\n * one hour as it is one minute short of two hours.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#until}:\n *
\n * // these two lines are equivalent\n * between = thisUnit.between(start, end);\n * between = start.until(end, thisUnit);\n *\n * The choice should be made based on which makes the code more readable.\n *\n * For example, this method allows the number of days between two dates to be calculated:\n *
\n * long daysBetween = DAYS.between(start, end);\n * // or alternatively\n * long daysBetween = start.until(end, DAYS);\n *\n * Implementations should perform any queries or calculations using the units available in\n * {@link ChronoUnit} or the fields available in {@link ChronoField}.\n * If the unit is not supported a DateTimeException must be thrown.\n * Implementations must not alter the specified temporal objects.\n *\n * @param {Temporal} temporal1 the base temporal object, not null\n * @param {Temporal} temporal2 the other temporal object, not null\n * @return {number} the period between temporal1 and temporal2 in terms of this unit;\n * positive if temporal2 is later than temporal1, negative if earlier\n * @throws DateTimeException if the period cannot be calculated\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n between(temporal1, temporal2) {\n abstractMethodFail('between');\n }\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 */\nimport {requireNonNull, requireInstance} from './assert';\nimport {ArithmeticException, DateTimeParseException, UnsupportedTemporalTypeException} from './errors';\nimport {MathUtil, MAX_SAFE_INTEGER, MIN_SAFE_INTEGER} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalAmount} from './temporal/TemporalAmount';\nimport {TemporalUnit} from './temporal/TemporalUnit';\n\nimport {LocalTime} from './LocalTime';\n\n/**\n * A time-based amount of time, such as '34.5 seconds'.\n *\n * This class models a quantity or amount of time in terms of seconds and nanoseconds.\n * It can be accessed using other duration-based units, such as minutes and hours.\n * In addition, the {@link ChronoUnit#DAYS} unit can be used and is treated as\n * exactly equal to 24 hours, thus ignoring daylight savings effects.\n * See {@link Period} for the date-based equivalent to this class.\n *\n * A physical duration could be of infinite length.\n * For practicality, the duration is stored with constraints similar to {@link Instant}.\n * The duration uses nanosecond resolution with a maximum value of the seconds that can\n * be held in a `long`. This is greater than the current estimated age of the universe.\n *\n * The range of a duration requires the storage of a number larger than a `long`.\n * To achieve this, the class stores a `long` representing seconds and an `int`\n * representing nanosecond-of-second, which will always be between 0 and 999,999,999.\n *\n * The duration is measured in \"seconds\", but these are not necessarily identical to\n * the scientific \"SI second\" definition based on atomic clocks.\n * This difference only impacts durations measured near a leap-second and should not affect\n * most applications.\n * See {@link Instant} for a discussion as to the meaning of the second and time-scales.\n *\n * ### Static properties of Class {@link Duration}\n *\n * Duration.ZERO\n *\n * Constant for a duration of zero.\n *\n */\nexport class Duration extends TemporalAmount /*implements TemporalAmount, Comparable
\n * Duration.ofSeconds(3, 1);\n * Duration.ofSeconds(4, -999_999_999);\n * Duration.ofSeconds(2, 1000_000_001);\n *\n *\n * @param {Number} seconds - the number of seconds, positive or negative\n * @param {Number} nanoAdjustment the nanosecond adjustment to the number of seconds, positive or negative\n * @return {!Duration}\n * @throws ArithmeticException if the adjustment causes the seconds to exceed the capacity of {@link Duration}\n */\n static ofSeconds(seconds, nanoAdjustment = 0) {\n const secs = MathUtil.safeAdd(seconds, MathUtil.floorDiv(nanoAdjustment, LocalTime.NANOS_PER_SECOND));\n const nos = MathUtil.floorMod(nanoAdjustment, LocalTime.NANOS_PER_SECOND);\n return Duration._create(secs, nos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a number of milliseconds.\n *\n * The seconds and nanoseconds are extracted from the specified milliseconds.\n *\n * @param {Number} millis - the number of milliseconds, positive or negative\n * @return {!Duration}\n */\n static ofMillis(millis) {\n let secs = MathUtil.intDiv(millis, 1000);\n let mos = MathUtil.intMod(millis, 1000);\n if (mos < 0) {\n mos += 1000;\n secs--;\n }\n return Duration._create(secs, mos * 1000000);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a number of nanoseconds.\n *\n * The seconds and nanoseconds are extracted from the specified nanoseconds.\n *\n * @param {Number} nanos - the number of nanoseconds, positive or negative\n * @return {!Duration}\n */\n static ofNanos(nanos) {\n let secs = MathUtil.intDiv(nanos, LocalTime.NANOS_PER_SECOND);\n let nos = MathUtil.intMod(nanos, LocalTime.NANOS_PER_SECOND);\n if (nos < 0) {\n nos += LocalTime.NANOS_PER_SECOND;\n secs--;\n }\n return this._create(secs, nos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from a duration in the specified unit.\n *\n * The parameters represent the two parts of a phrase like '6 Hours'. For example:\n *
\n * Duration.of(3, SECONDS);\n * Duration.of(465, HOURS);\n *\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration (see {@link TemporalUnit#isDurationEstimated}) or\n * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.\n *\n * @param {Number} amount - the amount of the duration, measured in terms of the unit, positive or negative\n * @param {TemporalUnit} unit - the unit that the duration is measured in, must have an exact duration, not null\n * @return {!Duration}\n * @throws DateTimeException if the period unit has an estimated duration\n * @throws ArithmeticException if a numeric overflow occurs\n */\n static of(amount, unit) {\n return Duration.ZERO.plus(amount, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Duration} from an amount.\n *\n * This obtains a duration based on the specified amount.\n * A TemporalAmount represents an amount of time, which may be date-based\n * or time-based, which this factory extracts to a duration.\n *\n * The conversion loops around the set of units from the amount and uses\n * the duration of the unit to calculate the total Duration.\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration or be ChronoUnit.DAYS which\n * is treated as 24 hours. If any other units are found then an exception is thrown.\n *\n * @param {TemporalAmount} amount - the temporal amount to convert, not null\n * @return {Duration} the resulting duration, not null\n * @throws DateTimeException if the amount cannot be converted\n * @throws ArithmeticException if a numeric overflow occurs\n */\n static from(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount);\n let duration = Duration.ZERO;\n amount.units().forEach((unit) => {\n duration = duration.plus(amount.get(unit), unit);\n });\n return duration;\n }\n\n /**\n * Obtains an instance of {@link Duration} representing the duration between two instants.\n *\n * Obtains a {@link Duration} representing the duration between two instants.\n * This calculates the duration between two temporal objects of the same type.\n * The difference in seconds is calculated using {@link Temporal#until}.\n * The difference in nanoseconds is calculated using by querying the\n * {@link ChronoField#NANO_OF_SECOND} field.\n *\n * The result of this method can be a negative period if the end is before the start.\n * To guarantee to obtain a positive duration call abs() on the result.\n *\n * @param {Temporal} startInclusive - the start instant, inclusive, not null\n * @param {Temporal} endExclusive - the end instant, exclusive, not null\n * @return {!Duration}\n * @throws DateTimeException if the seconds between the temporals cannot be obtained\n * @throws ArithmeticException if the calculation exceeds the capacity of {@link Duration}\n */\n static between(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n let secs = startInclusive.until(endExclusive, ChronoUnit.SECONDS);\n let nanos = 0;\n if (startInclusive.isSupported(ChronoField.NANO_OF_SECOND) && endExclusive.isSupported(ChronoField.NANO_OF_SECOND)) {\n try {\n const startNos = startInclusive.getLong(ChronoField.NANO_OF_SECOND);\n nanos = endExclusive.getLong(ChronoField.NANO_OF_SECOND) - startNos;\n if (secs > 0 && nanos < 0) {\n nanos += LocalTime.NANOS_PER_SECOND;\n } else if (secs < 0 && nanos > 0) {\n nanos -= LocalTime.NANOS_PER_SECOND;\n } else if (secs === 0 && nanos !== 0) {\n // two possible meanings for result, so recalculate secs\n const adjustedEnd = endExclusive.with(ChronoField.NANO_OF_SECOND, startNos);\n secs = startInclusive.until(adjustedEnd, ChronoUnit.SECONDS);\n }\n } catch (e) {\n // ignore and only use seconds\n }\n }\n return this.ofSeconds(secs, nanos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a {@link Duration} from a text string such as {@link PnDTnHnMn.nS}.\n *\n * This will parse a textual representation of a duration, including the\n * string produced by {@link toString}. The formats accepted are based\n * on the ISO-8601 duration format {@link PnDTnHnMn.nS} with days\n * considered to be exactly 24 hours.\n *\n * The string starts with an optional sign, denoted by the ASCII negative\n * or positive symbol. If negative, the whole period is negated.\n * The ASCII letter \"P\" is next in upper or lower case.\n * There are then four sections, each consisting of a number and a suffix.\n * The sections have suffixes in ASCII of \"D\", \"H\", \"M\" and \"S\" for\n * days, hours, minutes and seconds, accepted in upper or lower case.\n * The suffixes must occur in order. The ASCII letter \"T\" must occur before\n * the first occurrence, if any, of an hour, minute or second section.\n * At least one of the four sections must be present, and if \"T\" is present\n * there must be at least one section after the \"T\".\n * The number part of each section must consist of one or more ASCII digits.\n * The number may be prefixed by the ASCII negative or positive symbol.\n * The number of days, hours and minutes must parse to a `long`.\n * The number of seconds must parse to a `long` with optional fraction.\n * The decimal point may be either a dot or a comma.\n * The fractional part may have from zero to 9 digits.\n *\n * The leading plus/minus sign, and negative values for other units are\n * not part of the ISO-8601 standard.\n *\n * Examples:\n *
\n * \"PT20.345S\" -> parses as \"20.345 seconds\"\n * \"PT15M\" -> parses as \"15 minutes\" (where a minute is 60 seconds)\n * \"PT10H\" -> parses as \"10 hours\" (where an hour is 3600 seconds)\n * \"P2D\" -> parses as \"2 days\" (where a day is 24 hours or 86400 seconds)\n * \"P2DT3H4M\" -> parses as \"2 days, 3 hours and 4 minutes\"\n * \"P-6H3M\" -> parses as \"-6 hours and +3 minutes\"\n * \"-P6H3M\" -> parses as \"-6 hours and -3 minutes\"\n * \"-P-6H+3M\" -> parses as \"+6 hours and -3 minutes\"\n *\n *\n * @param {String} text - the text to parse, not null\n * @return {Duration} the parsed duration, not null\n * @throws DateTimeParseException if the text cannot be parsed to a duration\n */\n static parse(text) {\n requireNonNull(text, 'text');\n /**\n * The pattern for parsing.\n */\n const PATTERN = new RegExp('([-+]?)P(?:([-+]?[0-9]+)D)?(T(?:([-+]?[0-9]+)H)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)(?:[.,]([0-9]{0,9}))?S)?)?', 'i');\n const matches = PATTERN.exec(text);\n if (matches !== null) {\n // check for letter T but no time sections\n if ('T' === matches[3] === false) {\n const negate = '-' === matches[1];\n const dayMatch = matches[2];\n const hourMatch = matches[4];\n const minuteMatch = matches[5];\n const secondMatch = matches[6];\n const fractionMatch = matches[7];\n if (dayMatch != null || hourMatch != null || minuteMatch != null || secondMatch != null) {\n const daysAsSecs = Duration._parseNumber(text, dayMatch, LocalTime.SECONDS_PER_DAY, 'days');\n const hoursAsSecs = Duration._parseNumber(text, hourMatch, LocalTime.SECONDS_PER_HOUR, 'hours');\n const minsAsSecs = Duration._parseNumber(text, minuteMatch, LocalTime.SECONDS_PER_MINUTE, 'minutes');\n const seconds = Duration._parseNumber(text, secondMatch, 1, 'seconds');\n const negativeSecs = secondMatch != null && secondMatch.charAt(0) === '-';\n const nanos = Duration._parseFraction(text, fractionMatch, negativeSecs ? -1 : 1);\n try {\n return Duration._create(negate, daysAsSecs, hoursAsSecs, minsAsSecs, seconds, nanos);\n } catch (ex) {\n throw new DateTimeParseException('Text cannot be parsed to a Duration: overflow', text, 0, ex);\n }\n }\n }\n }\n throw new DateTimeParseException('Text cannot be parsed to a Duration', text, 0);\n }\n\n static _parseNumber(text, parsed, multiplier, errorText) {\n // regex limits to [-+]?[0-9]+\n if (parsed == null) {\n return 0;\n }\n try {\n if (parsed[0] === '+') {\n parsed = parsed.substring(1);\n }\n return MathUtil.safeMultiply(parseFloat(parsed), multiplier);\n } catch (ex) {\n throw new DateTimeParseException('Text cannot be parsed to a Duration: ' + errorText, text, 0, ex);\n }\n }\n\n static _parseFraction(text, parsed, negate) {\n // regex limits to [0-9]{0,9}\n if (parsed == null || parsed.length === 0) {\n return 0;\n }\n parsed = (parsed + '000000000').substring(0, 9);\n return parseFloat(parsed) * negate;\n }\n\n //-----------------------------------------------------------------------\n /**\n * to handle function overriding this function accepts any number of arguments, checks their type and delegates to the appropriate\n * function\n *\n * @return {Duration}\n */\n static _create() {\n if (arguments.length <= 2) {\n return Duration._createSecondsNanos(arguments[0], arguments[1]);\n } else {\n return Duration._createNegateDaysHoursMinutesSecondsNanos(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n }\n\n static _createNegateDaysHoursMinutesSecondsNanos(negate, daysAsSecs, hoursAsSecs, minsAsSecs, secs, nanos) {\n const seconds = MathUtil.safeAdd(daysAsSecs, MathUtil.safeAdd(hoursAsSecs, MathUtil.safeAdd(minsAsSecs, secs)));\n if (negate) {\n return Duration.ofSeconds(seconds, nanos).negated();\n }\n return Duration.ofSeconds(seconds, nanos);\n }\n\n /**\n * Obtains an instance of {@link Duration} using seconds and nanoseconds.\n *\n * @param {Number} seconds - the length of the duration in seconds, positive or negative\n * @param {Number} nanoAdjustment - the nanosecond adjustment within the second, from 0 to 999,999,999\n */\n static _createSecondsNanos(seconds = 0, nanoAdjustment = 0) {\n if ((seconds | nanoAdjustment) === 0) {\n return Duration.ZERO;\n }\n return new Duration(seconds, nanoAdjustment);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the value of the requested unit.\n *\n * This returns a value for each of the two supported units,\n * {@link ChronoUnit#SECONDS} and {@link ChronoUnit#NANOS}.\n * All other units throw an exception.\n *\n * @param {TemporalUnit} unit the {@link TemporalUnit} for which to return the value\n * @return {number} the const value of the unit\n * @throws DateTimeException if the unit is not supported\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n */\n get(unit) {\n if (unit === ChronoUnit.SECONDS) {\n return this._seconds;\n } else if (unit === ChronoUnit.NANOS) {\n return this._nanos;\n } else {\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n }\n\n units() {\n return [ChronoUnit.SECONDS, ChronoUnit.NANOS];\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this duration is zero length.\n *\n * A {@link Duration} represents a directed distance between two points on\n * the time-line and can therefore be positive, zero or negative.\n * This method checks whether the length is zero.\n *\n * @return {boolean} true if this duration has a total length equal to zero\n */\n isZero() {\n return (this._seconds | this._nanos) === 0;\n }\n\n /**\n * Checks if this duration is negative, excluding zero.\n *\n * A {@link Duration} represents a directed distance between two points on\n * the time-line and can therefore be positive, zero or negative.\n * This method checks whether the length is less than zero.\n *\n * @return {boolean} true if this duration has a total length less than zero\n */\n isNegative() {\n return this._seconds < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the number of seconds in this duration.\n *\n * The length of the duration is stored using two fields - seconds and nanoseconds.\n * The nanoseconds part is a value from 0 to 999,999,999 that is an adjustment to\n * the length in seconds.\n * The total duration is defined by calling this method and {@link getNano}.\n *\n * A {@link Duration} represents a directed distance between two points on the time-line.\n * A negative duration is expressed by the negative sign of the seconds part.\n * A duration of -1 nanosecond is stored as -1 seconds plus 999,999,999 nanoseconds.\n *\n * @return {number} the whole seconds part of the length of the duration, positive or negative\n */\n seconds() {\n return this._seconds;\n }\n\n /**\n * Gets the number of nanoseconds within the second in this duration.\n *\n * The length of the duration is stored using two fields - seconds and nanoseconds.\n * The nanoseconds part is a value from 0 to 999,999,999 that is an adjustment to\n * the length in seconds.\n * The total duration is defined by calling this method and {@link getSeconds}.\n *\n * A {@link Duration} represents a directed distance between two points on the time-line.\n * A negative duration is expressed by the negative sign of the seconds part.\n * A duration of -1 nanosecond is stored as -1 seconds plus 999,999,999 nanoseconds.\n *\n * @return {number} the nanoseconds within the second part of the length of the duration, from 0 to 999,999,999\n */\n nano() {\n return this._nanos;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified amount of seconds.\n *\n * This returns a duration with the specified seconds, retaining the\n * nano-of-second part of this duration.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} seconds - the seconds to represent, may be negative\n * @return {Duration} based on this period with the requested seconds, not null\n */\n withSeconds(seconds) {\n return Duration._create(seconds, this._nanos);\n }\n\n /**\n * Returns a copy of this duration with the specified nano-of-second.\n *\n * This returns a duration with the specified nano-of-second, retaining the\n * seconds part of this duration.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanoOfSecond - the nano-of-second to represent, from 0 to 999,999,999\n * @return {Duration} based on this period with the requested nano-of-second, not null\n * @throws DateTimeException if the nano-of-second is invalid\n */\n withNanos(nanoOfSecond) {\n ChronoField.NANO_OF_SECOND.checkValidIntValue(nanoOfSecond);\n return Duration._create(this._seconds, nanoOfSecond);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified duration added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Duration} duration - the duration to add, positive or negative, not null\n * @return {Duration} based on this duration with the specified duration added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusDuration(duration) {\n requireNonNull(duration, 'duration');\n return this.plus(duration.seconds(), duration.nano());\n }\n\n\n /**\n * function overloading for {@link Duration.plus}\n *\n * if called with 1 arguments, then {@link Duration.plusDuration} is executed.\n *\n * if called with 2 arguments and second argument is an instance of TemporalUnit, then {@link Duration.plusAmountUnit} is executed.\n *\n * Otherwise {@link Duration.plusSecondsNanos} is executed.\n *\n * @param {!(Duration|number)} durationOrNumber\n * @param {!TemporaloUnit|number} unitOrNumber\n * @returns {Duration}\n */\n plus(durationOrNumber, unitOrNumber) {\n if (arguments.length === 1) {\n return this.plusDuration(durationOrNumber);\n }\n else if (arguments.length === 2 && unitOrNumber instanceof TemporalUnit) {\n return this.plusAmountUnit(durationOrNumber, unitOrNumber);\n } else {\n return this.plusSecondsNanos(durationOrNumber, unitOrNumber);\n }\n }\n\n /**\n * Returns a copy of this duration with the specified duration added.\n *\n * The duration amount is measured in terms of the specified unit.\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration (see {@link TemporalUnit#isDurationEstimated}) or\n * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} amountToAdd - the amount to add, measured in terms of the unit, positive or negative\n * @param {TemporalUnit} unit - the unit that the amount is measured in, must have an exact duration, not null\n * @return {Duration} based on this duration with the specified duration added, not null\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n if (unit === ChronoUnit.DAYS) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_DAY), 0);\n }\n if (unit.isDurationEstimated()) {\n throw new UnsupportedTemporalTypeException('Unit must not have an estimated duration');\n }\n if (amountToAdd === 0) {\n return this;\n }\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this.plusSecondsNanos(MathUtil.intDiv(amountToAdd, (1000000 * 1000)) * 1000, MathUtil.intMod(amountToAdd, (1000000 * 1000)) * 1000);\n case ChronoUnit.MILLIS: return this.plusMillis(amountToAdd);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n }\n return this.plusSecondsNanos(MathUtil.safeMultiply(unit.duration().seconds(), amountToAdd), 0);\n }\n const duration = unit.duration().multipliedBy(amountToAdd);\n return this.plusSecondsNanos(duration.seconds(), duration.nano());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified duration in 24 hour days added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} daysToAdd - the days to add, positive or negative\n * @return {Duration} based on this duration with the specified days added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusDays(daysToAdd) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(daysToAdd, LocalTime.SECONDS_PER_DAY), 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in hours added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} hoursToAdd - the hours to add, positive or negative\n * @return {Duration} based on this duration with the specified hours added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusHours(hoursToAdd) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(hoursToAdd, LocalTime.SECONDS_PER_HOUR), 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in minutes added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} minutesToAdd - the minutes to add, positive or negative\n * @return {Duration} based on this duration with the specified minutes added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMinutes(minutesToAdd) {\n return this.plusSecondsNanos(MathUtil.safeMultiply(minutesToAdd, LocalTime.SECONDS_PER_MINUTE), 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in seconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} secondsToAdd - the seconds to add, positive or negative\n * @return {Duration} based on this duration with the specified seconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusSeconds(secondsToAdd) {\n return this.plusSecondsNanos(secondsToAdd, 0);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in milliseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} millisToAdd - the milliseconds to add, positive or negative\n * @return {Duration} based on this duration with the specified milliseconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMillis(millisToAdd) {\n return this.plusSecondsNanos(MathUtil.intDiv(millisToAdd, 1000), MathUtil.intMod(millisToAdd, 1000) * 1000000);\n }\n\n /**\n * Returns a copy of this duration with the specified duration in nanoseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanosToAdd - the nanoseconds to add, positive or negative\n * @return {Duration} based on this duration with the specified nanoseconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusNanos(nanosToAdd) {\n return this.plusSecondsNanos(0, nanosToAdd);\n }\n\n /**\n * Returns a copy of this duration with the specified duration added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} secondsToAdd - the seconds to add, positive or negative\n * @param {Number} nanosToAdd - the nanos to add, positive or negative\n * @return {Duration} based on this duration with the specified seconds added, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusSecondsNanos(secondsToAdd, nanosToAdd) {\n requireNonNull(secondsToAdd, 'secondsToAdd');\n requireNonNull(nanosToAdd, 'nanosToAdd');\n if ((secondsToAdd | nanosToAdd) === 0) {\n return this;\n }\n let epochSec = MathUtil.safeAdd(this._seconds, secondsToAdd);\n epochSec = MathUtil.safeAdd(epochSec, MathUtil.intDiv(nanosToAdd, LocalTime.NANOS_PER_SECOND));\n nanosToAdd = MathUtil.intMod(nanosToAdd, LocalTime.NANOS_PER_SECOND);\n const nanoAdjustment = MathUtil.safeAdd(this._nanos, nanosToAdd); // safe int+LocalTime.NANOS_PER_SECOND\n return Duration.ofSeconds(epochSec, nanoAdjustment);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Duration.minus}\n *\n * if called with 1 arguments and first argument is an instance of Duration, then {@link Duration.minusDuration} is executed.\n *\n * Otherwise {@link Duration.minusAmountUnit} is executed.\n *\n * @param {!(Duration|number)} durationOrNumber\n * @param {?ChronoUnit} unit\n * @return {Duration}\n */\n minus(durationOrNumber, unit) {\n if (arguments.length === 1) {\n return this.minusDuration(durationOrNumber);\n } else {\n return this.minusAmountUnit(durationOrNumber, unit);\n }\n }\n\n /**\n * Returns a copy of this duration with the specified duration subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Duration} duration - the duration to subtract, positive or negative, not null\n * @return {Duration} based on this duration with the specified duration subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusDuration(duration) {\n requireNonNull(duration, 'duration');\n const secsToSubtract = duration.seconds();\n const nanosToSubtract = duration.nano();\n if (secsToSubtract === MIN_SAFE_INTEGER) {\n return this.plus(MAX_SAFE_INTEGER, -nanosToSubtract);\n }\n return this.plus(-secsToSubtract, -nanosToSubtract);\n }\n\n /**\n * Returns a copy of this duration with the specified duration subtracted.\n *\n * The duration amount is measured in terms of the specified unit.\n * Only a subset of units are accepted by this method.\n * The unit must either have an exact duration (see {@link TemporalUnit#isDurationEstimated}) or\n * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} amountToSubtract - the amount to subtract, measured in terms of the unit, positive or negative\n * @param {TemporalUnit} unit - the unit that the amount is measured in, must have an exact duration, not null\n * @return {Duration} based on this duration with the specified duration subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmountUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n return (amountToSubtract === MIN_SAFE_INTEGER ? this.plusAmountUnit(MAX_SAFE_INTEGER, unit) : this.plusAmountUnit(-amountToSubtract, unit));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the specified duration in 24 hour days subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} daysToSubtract - the days to subtract, positive or negative\n * @return {Duration} based on this duration with the specified days subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusDays(daysToSubtract) {\n return (daysToSubtract === MIN_SAFE_INTEGER ? this.plusDays(MAX_SAFE_INTEGER) : this.plusDays(-daysToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in hours subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} hoursToSubtract - the hours to subtract, positive or negative\n * @return {Duration} based on this duration with the specified hours subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusHours(hoursToSubtract) {\n return (hoursToSubtract === MIN_SAFE_INTEGER ? this.plusHours(MAX_SAFE_INTEGER) : this.plusHours(-hoursToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in minutes subtracted.\n *\n * The number of hours is multiplied by 60 to obtain the number of seconds to subtract.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} minutesToSubtract - the minutes to subtract, positive or negative\n * @return {Duration} based on this duration with the specified minutes subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMinutes(minutesToSubtract) {\n return (minutesToSubtract === MIN_SAFE_INTEGER ? this.plusMinutes(MAX_SAFE_INTEGER) : this.plusMinutes(-minutesToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in seconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} secondsToSubtract - the seconds to subtract, positive or negative\n * @return {Duration} based on this duration with the specified seconds subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusSeconds(secondsToSubtract) {\n return (secondsToSubtract === MIN_SAFE_INTEGER ? this.plusSeconds(MAX_SAFE_INTEGER) : this.plusSeconds(-secondsToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in milliseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} millisToSubtract - the milliseconds to subtract, positive or negative\n * @return {Duration} based on this duration with the specified milliseconds subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMillis(millisToSubtract) {\n return (millisToSubtract === MIN_SAFE_INTEGER ? this.plusMillis(MAX_SAFE_INTEGER) : this.plusMillis(-millisToSubtract));\n }\n\n /**\n * Returns a copy of this duration with the specified duration in nanoseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanosToSubtract - the nanoseconds to subtract, positive or negative\n * @return {Duration} based on this duration with the specified nanoseconds subtracted, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusNanos(nanosToSubtract) {\n return (nanosToSubtract === MIN_SAFE_INTEGER ? this.plusNanos(MAX_SAFE_INTEGER) : this.plusNanos(-nanosToSubtract));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration multiplied by the scalar.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} multiplicand - the value to multiply the duration by, positive or negative\n * @return {Duration} based on this duration multiplied by the specified scalar, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n multipliedBy(multiplicand) {\n if (multiplicand === 0) {\n return Duration.ZERO;\n }\n if (multiplicand === 1) {\n return this;\n }\n let secs = MathUtil.safeMultiply(this._seconds, multiplicand);\n let nos = MathUtil.safeMultiply(this._nanos, multiplicand);\n secs = secs + MathUtil.intDiv(nos, LocalTime.NANOS_PER_SECOND);\n nos = MathUtil.intMod(nos, LocalTime.NANOS_PER_SECOND);\n return Duration.ofSeconds(secs, nos);\n }\n\n /**\n * Returns a copy of this duration divided by the specified value.\n *\n * In opposite to the threeten implementation the division is realized by floating point not by\n * fixed point arithmetic. Expect floating point rounding errors for {@link Duration.dividedBy}.\n *\n * @param {Number} divisor - the value to divide the duration by, positive or negative, not zero\n * @return {Duration} based on this duration divided by the specified divisor, not null\n * @throws ArithmeticException if the divisor is zero or if numeric overflow occurs\n */\n dividedBy(divisor) {\n if (divisor === 0) {\n throw new ArithmeticException('Cannot divide by zero');\n }\n if (divisor === 1) {\n return this;\n }\n const secs = MathUtil.intDiv(this._seconds, divisor);\n const secsMod = MathUtil.roundDown(((this._seconds/ divisor) - secs) * LocalTime.NANOS_PER_SECOND);\n let nos = MathUtil.intDiv(this._nanos, divisor);\n nos = secsMod + nos;\n return Duration.ofSeconds(secs, nos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this duration with the length negated.\n *\n * This method swaps the sign of the total length of this duration.\n * For example, {@link PT1.3S} will be returned as {@link PT-1.3S}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {Duration} based on this duration with the amount negated, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n negated() {\n return this.multipliedBy(-1);\n }\n\n /**\n * Returns a copy of this duration with a positive length.\n *\n * This method returns a positive duration by effectively removing the sign from any negative total length.\n * For example, {@link PT-1.3S} will be returned as {@link PT1.3S}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {Duration} based on this duration with an absolute length, not null\n * @throws ArithmeticException if numeric overflow occurs\n */\n abs() {\n return this.isNegative() ? this.negated() : this;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Adds this duration to the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this duration added.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#plus}.\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = thisDuration.addTo(dateTime);\n * dateTime = dateTime.plus(thisDuration);\n *\n *\n * The calculation will add the seconds, then nanos.\n * Only non-zero amounts will be added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to add\n * @throws ArithmeticException if numeric overflow occurs\n */\n addTo(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._seconds !== 0) {\n temporal = temporal.plus(this._seconds, ChronoUnit.SECONDS);\n }\n if (this._nanos !== 0) {\n temporal = temporal.plus(this._nanos, ChronoUnit.NANOS);\n }\n return temporal;\n }\n\n /**\n * Subtracts this duration from the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this duration subtracted.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#minus}.\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = thisDuration.subtractFrom(dateTime);\n * dateTime = dateTime.minus(thisDuration);\n *\n *\n * The calculation will subtract the seconds, then nanos.\n * Only non-zero amounts will be added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to subtract\n * @throws ArithmeticException if numeric overflow occurs\n */\n subtractFrom(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._seconds !== 0) {\n temporal = temporal.minus(this._seconds, ChronoUnit.SECONDS);\n }\n if (this._nanos !== 0) {\n temporal = temporal.minus(this._nanos, ChronoUnit.NANOS);\n }\n return temporal;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the number of days in this duration.\n *\n * This returns the total number of days in the duration by dividing the\n * number of seconds by 86400.\n * This is based on the standard definition of a day as 24 hours.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the number of days in the duration, may be negative\n */\n toDays() {\n return MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_DAY);\n }\n\n /**\n * Gets the number of hours in this duration.\n *\n * This returns the total number of hours in the duration by dividing the\n * number of seconds by 3600.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the number of hours in the duration, may be negative\n */\n toHours() {\n return MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_HOUR);\n }\n\n /**\n * Gets the number of minutes in this duration.\n *\n * This returns the total number of minutes in the duration by dividing the\n * number of seconds by 60.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {number} the number of minutes in the duration, may be negative\n */\n toMinutes() {\n return MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_MINUTE);\n }\n\n /**\n * Converts this duration to the total length in milliseconds.\n *\n * If this duration is too large to fit in a `long` milliseconds, then an\n * exception is thrown.\n *\n * If this duration has greater than millisecond precision, then the conversion\n * will drop any excess precision information as though the amount in nanoseconds\n * was subject to integer division by one million.\n *\n * @return {number} the total length of the duration in milliseconds\n * @throws ArithmeticException if numeric overflow occurs\n */\n toMillis() {\n let millis = Math.round(MathUtil.safeMultiply(this._seconds, 1000));\n millis = MathUtil.safeAdd(millis, MathUtil.intDiv(this._nanos, 1000000));\n return millis;\n }\n\n /**\n * Converts this duration to the total length in nanoseconds expressed as a `long`.\n *\n * If this duration is too large to fit in a `long` nanoseconds, then an\n * exception is thrown.\n *\n * @return {number} the total length of the duration in nanoseconds\n * @throws ArithmeticException if numeric overflow occurs\n */\n toNanos() {\n let totalNanos = MathUtil.safeMultiply(this._seconds, LocalTime.NANOS_PER_SECOND);\n totalNanos = MathUtil.safeAdd(totalNanos, this._nanos);\n return totalNanos;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this duration to the specified {@link Duration}.\n *\n * The comparison is based on the total length of the durations.\n *\n * @param {Duration} otherDuration - the other duration to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(otherDuration) {\n requireNonNull(otherDuration, 'otherDuration');\n requireInstance(otherDuration, Duration, 'otherDuration');\n const cmp = MathUtil.compareNumbers(this._seconds, otherDuration.seconds());\n if (cmp !== 0) {\n return cmp;\n }\n return this._nanos - otherDuration.nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this duration is equal to the specified {@link Duration}.\n *\n * The comparison is based on the total length of the durations.\n *\n * @param {*} otherDuration - the other duration, null returns false\n * @return {boolean} true if the other duration is equal to this one\n */\n equals(otherDuration) {\n if (this === otherDuration) {\n return true;\n }\n if (otherDuration instanceof Duration) {\n return this.seconds() === otherDuration.seconds() &&\n this.nano() === otherDuration.nano();\n }\n return false;\n }\n\n //-----------------------------------------------------------------------\n /**\n * A string representation of this duration using ISO-8601 seconds\n * based representation, such as {@link PT8H6M12.345S}.\n *\n * The format of the returned string will be {@link PTnHnMnS}, where n is\n * the relevant hours, minutes or seconds part of the duration.\n * Any fractional seconds are placed after a decimal povar i the seconds section.\n * If a section has a zero value, it is omitted.\n * The hours, minutes and seconds will all have the same sign.\n *\n * Examples:\n *
\n * \"20.345 seconds\" -> \"PT20.345S\n * \"15 minutes\" (15 * 60 seconds) -> \"PT15M\"\n * \"10 hours\" (10 * 3600 seconds) -> \"PT10H\"\n * \"2 days\" (2 * 86400 seconds) -> \"PT48H\"\n *\n * Note that multiples of 24 hours are not output as days to avoid confusion\n * with {@link Period}.\n *\n * @return {string} an ISO-8601 representation of this duration, not null\n */\n toString() {\n if (this === Duration.ZERO) {\n return 'PT0S';\n }\n const hours = MathUtil.intDiv(this._seconds, LocalTime.SECONDS_PER_HOUR);\n const minutes = MathUtil.intDiv(MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_HOUR), LocalTime.SECONDS_PER_MINUTE);\n const secs = MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_MINUTE);\n let rval = 'PT';\n if (hours !== 0) {\n rval += hours + 'H';\n }\n if (minutes !== 0) {\n rval += minutes + 'M';\n }\n if (secs === 0 && this._nanos === 0 && rval.length > 2) {\n return rval;\n }\n if (secs < 0 && this._nanos > 0) {\n if (secs === -1) {\n rval += '-0';\n } else {\n rval += secs + 1;\n }\n } else {\n rval += secs;\n }\n if (this._nanos > 0) {\n rval += '.';\n let nanoString;\n if (secs < 0) {\n nanoString = '' + (2 * LocalTime.NANOS_PER_SECOND - this._nanos);\n } else {\n nanoString = '' + (LocalTime.NANOS_PER_SECOND + this._nanos);\n }\n // remove the leading '1'\n nanoString = nanoString.slice(1, nanoString.length);\n rval += nanoString;\n while (rval.charAt(rval.length - 1) === '0') {\n rval = rval.slice(0, rval.length - 1);\n }\n }\n rval += 'S';\n return rval;\n }\n\n /**\n *\n * @return {string} same as {@link Duration.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n}\n\nexport function _init() {\n /**\n * Constant for a duration of zero.\n */\n Duration.ZERO = new Duration(0, 0);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n/**\n * attempt to avoid dependency cycles... define all constants here and they could be used\n * so instead of using e.g. Year.MAX_VALUE we could use YearConstants.MAX_VALUE to avoid the cycle\n */\nexport class YearConstants {}\n\nexport function _init() {\n /**\n * The minimum supported year\n */\n YearConstants.MIN_VALUE = -999999;\n /**\n * The maximum supported year\n */\n YearConstants.MAX_VALUE = 999999;\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 {MathUtil} from '../MathUtil';\n\nimport {Duration} from '../Duration';\nimport {YearConstants} from '../YearConstants';\nimport {TemporalUnit} from './TemporalUnit';\n\n/**\n * A standard set of date periods units.\n *\n * This set of units provide unit-based access to manipulate a date, time or date-time.\n * The standard set of units can be extended by implementing {@link TemporalUnit}.\n *\n * These units are intended to be applicable in multiple calendar systems.\n * For example, most non-ISO calendar systems define units of years, months and days,\n * just with slightly different rules.\n * The documentation of each unit explains how it operates.\n *\n * ### Static properties of Class {@link ChronoUnit}\n *\n * ChronoUnit.NANOS\n *\n * Unit that represents the concept of a nanosecond, the smallest supported unit of time.\n * For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.\n *\n * ChronoUnit.MICROS\n *\n * Unit that represents the concept of a microsecond.\n * For the ISO calendar system, it is equal to the 1,000,000th part of the second unit.\n *\n * ChronoUnit.MILLIS\n *\n * Unit that represents the concept of a millisecond.\n * For the ISO calendar system, it is equal to the 1000th part of the second unit.\n *\n * ChronoUnit.SECONDS\n *\n * Unit that represents the concept of a second.\n * For the ISO calendar system, it is equal to the second in the SI system\n * of units, except around a leap-second.\n *\n * ChronoUnit.MINUTES\n *\n * Unit that represents the concept of a minute.\n * For the ISO calendar system, it is equal to 60 seconds.\n *\n * ChronoUnit.HOURS\n *\n * Unit that represents the concept of an hour.\n * For the ISO calendar system, it is equal to 60 minutes.\n *\n * ChronoUnit.HALF_DAYS\n *\n * Unit that represents the concept of half a day, as used in AM/PM.\n * For the ISO calendar system, it is equal to 12 hours.\n *\n * ChronoUnit.DAYS\n *\n * Unit that represents the concept of a day.\n * For the ISO calendar system, it is the standard day from midnight to midnight.\n * The estimated duration of a day is 24 hours.\n *\n * When used with other calendar systems it must correspond to the day defined by\n * the rising and setting of the Sun on Earth. It is not required that days begin\n * at midnight - when converting between calendar systems, the date should be\n * equivalent at midday.\n *\n * ChronoUnit.WEEKS\n *\n * Unit that represents the concept of a week.\n * For the ISO calendar system, it is equal to 7 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days.\n *\n * ChronoUnit.MONTHS\n *\n * Unit that represents the concept of a month.\n * For the ISO calendar system, the length of the month varies by month-of-year.\n * The estimated duration of a month is one twelfth of 365.2425 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days.\n *\n * ChronoUnit.YEARS\n *\n * Unit that represents the concept of a year.\n * For the ISO calendar system, it is equal to 12 months.\n * The estimated duration of a year is 365.2425 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * or months roughly equal to a year defined by the passage of the Earth around the Sun.\n *\n * ChronoUnit.DECADES\n *\n * Unit that represents the concept of a decade.\n * For the ISO calendar system, it is equal to 10 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n *\n * ChronoUnit.CENTURIES\n *\n * Unit that represents the concept of a century.\n * For the ISO calendar system, it is equal to 100 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n *\n * ChronoUnit.MILLENNIA\n *\n * Unit that represents the concept of a millennium.\n * For the ISO calendar system, it is equal to 1000 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n *\n * ChronoUnit.ERAS\n *\n * Unit that represents the concept of an era.\n * The ISO calendar system doesn't have eras thus it is impossible to add\n * an era to a date or date-time.\n * The estimated duration of the era is artificially defined as {Year.MAX_VALUE} + 1.\n *\n * When used with other calendar systems there are no restrictions on the unit.\n *\n * ChronoUnit.FOREVER\n *\n * Artificial unit that represents the concept of forever.\n * This is primarily used with {@link TemporalField} to represent unbounded fields\n * such as the year or era.\n * The estimated duration of the era is artificially defined as the largest duration\n * supported by {@link Duration}.\n *\n */\nexport class ChronoUnit extends TemporalUnit {\n\n /**\n *\n * @param {String} name\n * @param {Duration} estimatedDuration\n * @private\n */\n constructor (name, estimatedDuration) {\n super();\n this._name = name;\n this._duration = estimatedDuration;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the estimated duration of this unit in the ISO calendar system.\n *\n * All of the units in this class have an estimated duration.\n * Days vary due to daylight saving time, while months have different lengths.\n *\n * @return {Duration} the estimated duration of this unit, not null\n */\n duration() {\n return this._duration;\n }\n\n /**\n * Checks if the duration of the unit is an estimate.\n *\n * All time units in this class are considered to be accurate, while all date\n * units in this class are considered to be estimated.\n *\n * This definition ignores leap seconds, but considers that Days vary due to\n * daylight saving time and months have different lengths.\n *\n * @return {boolean} true if the duration is estimated, false if accurate\n */\n isDurationEstimated() {\n return this.isDateBased() || this === ChronoUnit.FOREVER;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this unit is a date unit.\n *\n * @return true if a date unit, false if a time unit\n */\n isDateBased() {\n return this.compareTo(ChronoUnit.DAYS) >= 0 && this !== ChronoUnit.FOREVER;\n }\n\n /**\n * Checks if this unit is a time unit.\n *\n * @return true if a time unit, false if a date unit\n */\n isTimeBased() {\n return this.compareTo(ChronoUnit.DAYS) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this unit is supported by the specified temporal object.\n *\n * This checks that the implementing date-time can add/subtract this unit.\n * This can be used to avoid throwing an exception.\n *\n * This default implementation derives the value using\n * {@link Temporal#plus}.\n *\n * @param {Temporal} temporal the temporal object to check, not null\n * @return {boolean} true if the unit is supported\n */\n isSupportedBy(temporal) {\n if (this === ChronoUnit.FOREVER) {\n return false;\n }\n /* TODO: classes not implemented yet */\n /*\n if (temporal instanceof ChronoLocalDate) {\n return isDateBased();\n }\n if (temporal instanceof ChronoLocalDateTime || temporal instanceof ChronoZonedDateTime) {\n return true;\n }\n*/\n try {\n temporal.plus(1, this);\n return true;\n } catch (e) {\n try {\n temporal.plus(-1, this);\n return true;\n } catch (e2) {\n return false;\n }\n }\n }\n\n /**\n * Returns a copy of the specified temporal object with the specified period added.\n *\n * The period added is a multiple of this unit. For example, this method\n * could be used to add \"3 days\" to a date by calling this method on the\n * instance representing \"days\", passing the date and the period \"3\".\n * The period to be added may be negative, which is equivalent to subtraction.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#plus}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisUnit.addTo(temporal);\n * temporal = temporal.plus(thisUnit);\n *\n * It is recommended to use the second approach, {@link plus},\n * as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the units\n * available in {@link ChronoUnit} or the fields available in {@link ChronoField}.\n * If the unit is not supported an {@link UnsupportedTemporalTypeException} must be thrown.\n *\n * Implementations must not alter the specified temporal object.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable implementations.\n *\n * @param {Temporal} temporal the temporal object to adjust, not null\n * @param {Number} amount the amount of this unit to add, positive or negative\n * @return {Temporal} the adjusted temporal object, not null\n * @throws DateTimeException if the amount cannot be added\n * @throws UnsupportedTemporalTypeException if the unit is not supported by the temporal\n */\n addTo(temporal, amount) {\n return temporal.plus(amount, this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the amount of time between two temporal objects.\n *\n * This calculates the amount in terms of this unit. The start and end\n * points are supplied as temporal objects and must be of compatible types.\n * The implementation will convert the second type to be an instance of the\n * first type before the calculating the amount.\n * The result will be negative if the end is before the start.\n * For example, the amount in hours between two temporal objects can be\n * calculated using {@link HOURS.between}.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two temporals.\n * For example, the amount in hours between the times 11:30 and 13:29\n * will only be one hour as it is one minute short of two hours.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#until}:\n *
\n * // these two lines are equivalent\n * between = thisUnit.between(start, end);\n * between = start.until(end, thisUnit);\n *\n * The choice should be made based on which makes the code more readable.\n *\n * For example, this method allows the number of days between two dates to\n * be calculated:\n *
\n * daysBetween = DAYS.between(start, end);\n * // or alternatively\n * daysBetween = start.until(end, DAYS);\n *\n *\n * Implementations should perform any queries or calculations using the units\n * available in {@link ChronoUnit} or the fields available in {@link ChronoField}.\n * If the unit is not supported an {@link UnsupportedTemporalTypeException} must be thrown.\n * Implementations must not alter the specified temporal objects.\n *\n * @implSpec\n * Implementations must begin by checking to if the two temporals have the\n * same type using `.constructor.name`. If they do not, then the result must be\n * obtained by calling `temporal1.until`.\n *\n * @param {Temporal} temporal1 the base temporal object, not null\n * @param {Temporal} temporal2 the other temporal object, exclusive, not null\n * @return {Number} the amount of time between temporal1 and temporal2\n * in terms of this unit; positive if temporal2 is later than\n * temporal1, negative if earlier\n * @throws DateTimeException if the amount cannot be calculated, or the end\n * temporal cannot be converted to the same type as the start temporal\n * @throws UnsupportedTemporalTypeException if the unit is not supported by the temporal\n * @throws ArithmeticException if numeric overflow occurs\n */\n between(temporal1, temporal2) {\n return temporal1.until(temporal2, this);\n }\n\n //-----------------------------------------------------------------------\n toString() {\n return this._name;\n }\n\n /**\n * Compares this ChronoUnit to the specified {TemporalUnit}.\n *\n * The comparison is based on the total length of the durations.\n *\n * @param {TemporalUnit} other the other unit to compare to, not null\n * @return the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n return this.duration().compareTo(other.duration());\n }\n\n}\n\nexport function _init() {\n /**\n * Unit that represents the concept of a nanosecond, the smallest supported unit of time.\n * For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.\n */\n ChronoUnit.NANOS = new ChronoUnit('Nanos', Duration.ofNanos(1));\n /**\n * Unit that represents the concept of a microsecond.\n * For the ISO calendar system, it is equal to the 1,000,000th part of the second unit.\n */\n ChronoUnit.MICROS = new ChronoUnit('Micros', Duration.ofNanos(1000));\n /**\n * Unit that represents the concept of a millisecond.\n * For the ISO calendar system, it is equal to the 1000th part of the second unit.\n */\n ChronoUnit.MILLIS = new ChronoUnit('Millis', Duration.ofNanos(1000000));\n /**\n * Unit that represents the concept of a second.\n * For the ISO calendar system, it is equal to the second in the SI system\n * of units, except around a leap-second.\n */\n ChronoUnit.SECONDS = new ChronoUnit('Seconds', Duration.ofSeconds(1));\n /**\n * Unit that represents the concept of a minute.\n * For the ISO calendar system, it is equal to 60 seconds.\n */\n ChronoUnit.MINUTES = new ChronoUnit('Minutes', Duration.ofSeconds(60));\n /**\n * Unit that represents the concept of an hour.\n * For the ISO calendar system, it is equal to 60 minutes.\n */\n ChronoUnit.HOURS = new ChronoUnit('Hours', Duration.ofSeconds(3600));\n /**\n * Unit that represents the concept of half a day, as used in AM/PM.\n * For the ISO calendar system, it is equal to 12 hours.\n */\n ChronoUnit.HALF_DAYS = new ChronoUnit('HalfDays', Duration.ofSeconds(43200));\n /**\n * Unit that represents the concept of a day.\n * For the ISO calendar system, it is the standard day from midnight to midnight.\n * The estimated duration of a day is 24 hours.\n *\n * When used with other calendar systems it must correspond to the day defined by\n * the rising and setting of the Sun on Earth. It is not required that days begin\n * at midnight - when converting between calendar systems, the date should be\n * equivalent at midday.\n */\n ChronoUnit.DAYS = new ChronoUnit('Days', Duration.ofSeconds(86400));\n /**\n * Unit that represents the concept of a week.\n * For the ISO calendar system, it is equal to 7 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days.\n */\n ChronoUnit.WEEKS = new ChronoUnit('Weeks', Duration.ofSeconds(7 * 86400));\n /**\n * Unit that represents the concept of a month.\n * For the ISO calendar system, the length of the month varies by month-of-year.\n * The estimated duration of a month is one twelfth of 365.2425 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days.\n */\n ChronoUnit.MONTHS = new ChronoUnit('Months', Duration.ofSeconds(31556952 / 12));\n /**\n * Unit that represents the concept of a year.\n * For the ISO calendar system, it is equal to 12 months.\n * The estimated duration of a year is 365.2425 days.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * or months roughly equal to a year defined by the passage of the Earth around the Sun.\n */\n ChronoUnit.YEARS = new ChronoUnit('Years', Duration.ofSeconds(31556952));\n /**\n * Unit that represents the concept of a decade.\n * For the ISO calendar system, it is equal to 10 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n */\n ChronoUnit.DECADES = new ChronoUnit('Decades', Duration.ofSeconds(31556952 * 10));\n /**\n * Unit that represents the concept of a century.\n * For the ISO calendar system, it is equal to 100 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n */\n ChronoUnit.CENTURIES = new ChronoUnit('Centuries', Duration.ofSeconds(31556952 * 100));\n /**\n * Unit that represents the concept of a millennium.\n * For the ISO calendar system, it is equal to 1000 years.\n *\n * When used with other calendar systems it must correspond to an integral number of days\n * and is normally an integral number of years.\n */\n ChronoUnit.MILLENNIA = new ChronoUnit('Millennia', Duration.ofSeconds(31556952 * 1000));\n /**\n * Unit that represents the concept of an era.\n * The ISO calendar system doesn't have eras thus it is impossible to add\n * an era to a date or date-time.\n * The estimated duration of the era is artificially defined as {Year.MAX_VALUE} + 1.\n *\n * When used with other calendar systems there are no restrictions on the unit.\n */\n ChronoUnit.ERAS = new ChronoUnit('Eras', Duration.ofSeconds(31556952 * (YearConstants.MAX_VALUE + 1)));\n /**\n * Artificial unit that represents the concept of forever.\n * This is primarily used with {@link TemporalField} to represent unbounded fields\n * such as the year or era.\n * The estimated duration of the era is artificially defined as the largest duration\n * supported by {@link Duration}.\n */\n ChronoUnit.FOREVER = new ChronoUnit('Forever', Duration.ofSeconds(MathUtil.MAX_SAFE_INTEGER, 999999999));\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\n/**\n * A field of date-time, such as month-of-year or hour-of-minute.\n *\n * Date and time is expressed using fields which partition the time-line into something\n * meaningful for humans. Implementations of this interface represent those fields.\n *\n * The most commonly used units are defined in {@link ChronoField}.\n * Further fields are supplied in {@link IsoFields}, {@link WeekFields} and {@link JulianFields}.\n * Fields can also be written by application code by implementing this interface.\n *\n * The field works using double dispatch. Client code calls methods on a date-time like\n * {@link LocalDateTime} which check if the field is a {@link ChronoField}.\n * If it is, then the date-time must handle it.\n * Otherwise, the method call is re-dispatched to the matching method in this interface.\n *\n * @interface\n */\nexport class TemporalField {}\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 {assert} from '../assert';\nimport {DateTimeException, IllegalArgumentException} from '../errors';\nimport {MathUtil} from '../MathUtil';\n\n/**\n * The range of valid values for a date-time field.\n *\n * All TemporalField instances have a valid range of values.\n * For example, the ISO day-of-month runs from 1 to somewhere between 28 and 31.\n * This class captures that valid range.\n *\n * It is important to be aware of the limitations of this class.\n * Only the minimum and maximum values are provided.\n * It is possible for there to be invalid values within the outer range.\n * For example, a weird field may have valid values of 1, 2, 4, 6, 7, thus\n * have a range of '1 - 7', despite that fact that values 3 and 5 are invalid.\n *\n * Instances of this class are not tied to a specific field.\n */\nexport class ValueRange {\n\n /**\n *\n * @param {!number} minSmallest\n * @param {!number} minLargest\n * @param {!number} maxSmallest\n * @param {!number} maxLargest\n * @private\n */\n constructor(minSmallest, minLargest, maxSmallest, maxLargest) {\n assert(!(minSmallest > minLargest), 'Smallest minimum value \\'' + minSmallest +\n '\\' must be less than largest minimum value \\'' + minLargest + '\\'', IllegalArgumentException);\n assert(!(maxSmallest > maxLargest), 'Smallest maximum value \\'' + maxSmallest +\n '\\' must be less than largest maximum value \\'' + maxLargest + '\\'', IllegalArgumentException);\n assert(!(minLargest > maxLargest), 'Minimum value \\'' + minLargest +\n '\\' must be less than maximum value \\'' + maxLargest + '\\'', IllegalArgumentException);\n\n this._minSmallest = minSmallest;\n this._minLargest = minLargest;\n this._maxLargest = maxLargest;\n this._maxSmallest = maxSmallest;\n }\n\n /**\n * Is the value range fixed and fully known.\n *\n * For example, the ISO day-of-month runs from 1 to between 28 and 31.\n * Since there is uncertainty about the maximum value, the range is not fixed.\n * However, for the month of January, the range is always 1 to 31, thus it is fixed.\n *\n * @return {boolean} true if the set of values is fixed\n */\n isFixed() {\n return this._minSmallest === this._minLargest && this._maxSmallest === this._maxLargest;\n }\n\n /**\n *\n * @returns {number}\n */\n minimum(){\n return this._minSmallest;\n }\n\n /**\n *\n * @returns {number}\n */\n largestMinimum(){\n return this._minLargest;\n }\n\n /**\n *\n * @returns {number}\n */\n maximum(){\n return this._maxLargest;\n }\n\n /**\n *\n * @returns {number}\n */\n smallestMaximum(){\n return this._maxSmallest;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isValidValue(value) {\n return (this.minimum() <= value && value <= this.maximum());\n }\n\n /**\n *\n * @param {number} value\n * @param {TemporalField} field\n */\n checkValidValue(value, field) {\n let msg;\n if (!this.isValidValue(value)) {\n if (field != null) {\n msg = ('Invalid value for ' + field + ' (valid values ' + (this.toString()) + '): ') + value;\n } else {\n msg = ('Invalid value (valid values ' + (this.toString()) + '): ') + value;\n }\n return assert(false, msg, DateTimeException);\n }\n }\n\n /**\n * Checks that the specified value is valid and fits in an `int`.\n *\n * This validates that the value is within the valid range of values and that\n * all valid values are within the bounds of an `int`.\n * The field is only used to improve the error message.\n *\n * @param {number} value - the value to check\n * @param {TemporalField} field - the field being checked, may be null\n * @return {number} the value that was passed in\n * @see #isValidIntValue(long)\n */\n checkValidIntValue(value, field) {\n if (this.isValidIntValue(value) === false) {\n throw new DateTimeException('Invalid int value for ' + field + ': ' + value);\n }\n return value;\n }\n\n /**\n * Checks if the value is within the valid range and that all values\n * in the range fit in an `int`.\n *\n * This method combines {@link isIntValue} and {@link isValidValue}.\n *\n * @param {number} value - the value to check\n * @return true if the value is valid and fits in an `int`\n */\n isValidIntValue(value) {\n return this.isIntValue() && this.isValidValue(value);\n }\n\n /**\n * Checks if all values in the range fit in an `int`.\n *\n * This checks that all valid values are within the bounds of an `int`.\n *\n * For example, the ISO month-of-year has values from 1 to 12, which fits in an `int`.\n * By comparison, ISO nano-of-day runs from 1 to 86,400,000,000,000 which does not fit in an `int`.\n *\n * This implementation uses {@link getMinimum} and {@link getMaximum}.\n *\n * @return boolean if a valid value always fits in an `int`\n */\n isIntValue() { // should be isSafeIntegerValue\n return this.minimum() >= MathUtil.MIN_SAFE_INTEGER && this.maximum() <= MathUtil.MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if this range is equal to another range.\n *\n * The comparison is based on the four values, minimum, largest minimum,\n * smallest maximum and maximum.\n * Only objects of type {@link ValueRange} are compared, other types return false.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other range\n */\n equals(other) {\n if (other === this) {\n return true;\n }\n if (other instanceof ValueRange) {\n return this._minSmallest === other._minSmallest && this._minLargest === other._minLargest &&\n this._maxSmallest === other._maxSmallest && this._maxLargest === other._maxLargest;\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 MathUtil.hashCode(this._minSmallest, this._minLargest, this._maxSmallest, this._maxLargest);\n }\n\n /*\n * Outputs this range as a String.\n *\n * The format will be '{min}/{largestMin} - {smallestMax}/{max}',\n * where the largestMin or smallestMax sections may be omitted, together\n * with associated slash, if they are the same as the min or max.\n *\n * @return {string} a string representation of this range, not null\n */\n toString() {\n let str = this.minimum() + (this.minimum() !== this.largestMinimum() ? '/' + (this.largestMinimum()) : '');\n str += ' - ';\n str += this.smallestMaximum() + (this.smallestMaximum() !== this.maximum() ? '/' + (this.maximum()) : '');\n return str;\n }\n\n /*\n * called with 2 params: Obtains a fixed value range.\n *\n * This factory obtains a range where the minimum and maximum values are fixed.\n * For example, the ISO month-of-year always runs from 1 to 12.\n *\n * @param min the minimum value\n * @param max the maximum value\n * @return the ValueRange for min, max, not null\n\n * called with 3 params: Obtains a variable value range.\n *\n * This factory obtains a range where the minimum value is fixed and the maximum value may vary.\n * For example, the ISO day-of-month always starts at 1, but ends between 28 and 31.\n *\n * @param min the minimum value\n * @param maxSmallest the smallest maximum value\n * @param maxLargest the largest maximum value\n * @return the ValueRange for min, smallest max, largest max, not null\n\n * called with 4 params: Obtains a fully variable value range.\n *\n * This factory obtains a range where both the minimum and maximum value may vary.\n *\n * @param minSmallest the smallest minimum value\n * @param minLargest the largest minimum value\n * @param maxSmallest the smallest maximum value\n * @param maxLargest the largest maximum value\n *\n * @return {ValueRange} the ValueRange for smallest min, largest min, smallest max, largest max, not null\n */\n static of() {\n if (arguments.length === 2) {\n return new ValueRange(arguments[0], arguments[0], arguments[1], arguments[1]);\n } else if (arguments.length === 3) {\n return new ValueRange(arguments[0], arguments[0], arguments[1], arguments[2]);\n } else if (arguments.length === 4) {\n return new ValueRange(arguments[0], arguments[1], arguments[2], arguments[3]);\n } else {\n return assert(false, 'Invalid number of arguments ' + arguments.length, IllegalArgumentException);\n }\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 {MAX_SAFE_INTEGER, MIN_SAFE_INTEGER} from '../MathUtil';\n\nimport {ChronoUnit} from './ChronoUnit';\nimport {TemporalField} from './TemporalField';\nimport {ValueRange} from './ValueRange';\nimport {YearConstants} from '../YearConstants';\n\n/**\n * A standard set of fields.\n *\n * This set of fields provide field-based access to manipulate a date, time or date-time.\n * The standard set of fields can be extended by implementing {@link TemporalField}.\n *\n * These fields are intended to be applicable in multiple calendar systems.\n * For example, most non-ISO calendar systems define dates as a year, month and day,\n * just with slightly different rules.\n * The documentation of each field explains how it operates.\n *\n * ### Static properties of Class {@link ChronoField}\n *\n * ChronoField.NANO_OF_SECOND\n *\n * ChronoField.NANO_OF_DAY\n *\n * ChronoField.MICRO_OF_SECOND\n *\n * ChronoField.MICRO_OF_DAY\n *\n * ChronoField.MILLI_OF_SECOND\n *\n * ChronoField.MILLI_OF_DAY\n *\n * ChronoField.SECOND_OF_MINUTE\n *\n * ChronoField.SECOND_OF_DAY\n *\n * ChronoField.MINUTE_OF_HOUR\n *\n * ChronoField.MINUTE_OF_DAY\n *\n * ChronoField.HOUR_OF_AMPM\n *\n * ChronoField.CLOCK_HOUR_OF_AMPM\n *\n * ChronoField.HOUR_OF_DAY\n *\n * ChronoField.CLOCK_HOUR_OF_DAY\n *\n * ChronoField.AMPM_OF_DAY\n *\n * ChronoField.DAY_OF_WEEK\n *\n * ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH\n *\n * ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR\n *\n * ChronoField.DAY_OF_MONTH\n *\n * ChronoField.DAY_OF_YEAR\n *\n * ChronoField.EPOCH_DAY\n *\n * ChronoField.ALIGNED_WEEK_OF_MONTH\n *\n * ChronoField.ALIGNED_WEEK_OF_YEAR\n *\n * ChronoField.MONTH_OF_YEAR\n *\n * ChronoField.PROLEPTIC_MONTH\n *\n * ChronoField.YEAR_OF_ERA\n *\n * ChronoField.YEAR\n *\n * ChronoField.ERA\n *\n * ChronoField.INSTANT_SECONDS\n *\n * ChronoField.OFFSET_SECONDS\n *\n */\nexport class ChronoField extends TemporalField {\n\n /**\n * helper function to get one of the static ChronoField defines by name, needed to resolve ChronoField from EnumMap\n *\n * @param {String} fieldName\n * @return {ChronoField | null}\n */\n static byName(fieldName) {\n for (const prop in ChronoField) {\n if (ChronoField.hasOwnProperty(prop)) {\n if ((ChronoField[prop] instanceof ChronoField) && ChronoField[prop].name() === fieldName) {\n return ChronoField[prop];\n }\n }\n }\n }\n\n /**\n *\n * @param {!string} name\n * @param {!number} baseUnit\n * @param {!number} rangeUnit\n * @param {!ValueRange} range\n * @private\n */\n constructor(name, baseUnit, rangeUnit, range) {\n super();\n this._name = name;\n this._baseUnit = baseUnit;\n this._rangeUnit = rangeUnit;\n this._range = range;\n }\n\n /**\n *\n * @returns {string}\n */\n name(){\n return this._name;\n }\n\n /**\n *\n * @returns {!number}\n */\n baseUnit(){\n return this._baseUnit;\n }\n\n /**\n *\n * @returns {!number}\n */\n rangeUnit(){\n return this._rangeUnit;\n }\n\n /**\n *\n * @returns {!ValueRange}\n */\n range(){\n return this._range;\n }\n\n /**\n *\n * @returns {string}\n */\n displayName(){\n return this.toString();\n }\n\n /**\n *\n * @param {number} value\n * @returns {*}\n */\n checkValidValue(value) {\n return this.range().checkValidValue(value, this.name());\n }\n\n /**\n * Checks if this field represents a component of a date.\n *\n * @return {boolean} true if it is a component of a date\n */\n isDateBased() {\n const dateBased =\n this === ChronoField.DAY_OF_WEEK ||\n this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH ||\n this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR ||\n this === ChronoField.DAY_OF_MONTH ||\n this === ChronoField.DAY_OF_YEAR ||\n this === ChronoField.EPOCH_DAY ||\n this === ChronoField.ALIGNED_WEEK_OF_MONTH ||\n this === ChronoField.ALIGNED_WEEK_OF_YEAR ||\n this === ChronoField.MONTH_OF_YEAR ||\n //this === ChronoField.EPOCH_MONTH ||\n this === ChronoField.YEAR_OF_ERA ||\n this === ChronoField.YEAR ||\n this === ChronoField.ERA;\n return dateBased;\n }\n\n /**\n * Checks if this field represents a component of a time.\n *\n * @return {boolean} true if it is a component of a time\n */\n isTimeBased() {\n const timeBased =\n this === ChronoField.NANO_OF_SECOND ||\n this === ChronoField.NANO_OF_DAY ||\n this === ChronoField.MICRO_OF_SECOND ||\n this === ChronoField.MICRO_OF_DAY ||\n this === ChronoField.MILLI_OF_SECOND ||\n this === ChronoField.MILLI_OF_DAY ||\n this === ChronoField.SECOND_OF_MINUTE ||\n this === ChronoField.SECOND_OF_DAY ||\n this === ChronoField.MINUTE_OF_HOUR ||\n this === ChronoField.MINUTE_OF_DAY ||\n this === ChronoField.HOUR_OF_AMPM ||\n this === ChronoField.CLOCK_HOUR_OF_AMPM ||\n this === ChronoField.HOUR_OF_DAY ||\n this === ChronoField.CLOCK_HOUR_OF_DAY ||\n this === ChronoField.AMPM_OF_DAY;\n return timeBased;\n }\n\n /**\n * Get the range of valid values for this field using the temporal object to\n * refine the result.\n *\n * This uses the temporal object to find the range of valid values for the field.\n * This is similar to {@link range}, however this method refines the result\n * using the temporal. For example, if the field is {@link DAY_OF_MONTH} the\n * {@link range} method is not accurate as there are four possible month lengths,\n * 28, 29, 30 and 31 days. Using this method with a date allows the range to be\n * accurate, returning just one of those four options.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link TemporalAccessor#range}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisField.rangeRefinedBy(temporal);\n * temporal = temporal.range(thisField);\n *\n * It is recommended to use the second approach, {@link range},\n * as it is a lot clearer to read in code.\n *\n * Implementations should perform any queries or calculations using the fields\n * available in {@link ChronoField}.\n * If the field is not supported a {@link DateTimeException} must be thrown.\n *\n * @param {!TemporalAccessor} temporal - the temporal object used to refine the result, not null\n * @return {ValueRange} the range of valid values for this field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n */\n rangeRefinedBy(temporal) {\n return temporal.range(this);\n }\n\n /**\n * Checks that the specified value is valid and fits in an `int`.\n *\n * This validates that the value is within the outer range of valid values\n * returned by {@link range}.\n * It also checks that all valid values are within the bounds of an `int`.\n *\n * This method checks against the range of the field in the ISO-8601 calendar system.\n * This range may be incorrect for other calendar systems.\n * Use {@link Chronology#range} to access the correct range\n * for a different calendar system.\n *\n * @param {number} value - the value to check\n * @return {number} the value that was passed in\n */\n checkValidIntValue(value) {\n return this.range().checkValidIntValue(value, this);\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {number}\n */\n getFrom(temporal) {\n return temporal.getLong(this);\n }\n\n /**\n *\n * @returns {string}\n */\n toString(){\n return this.name();\n }\n\n /**\n *\n * @param {*} other\n * @returns {boolean}\n */\n equals(other){\n return this === other;\n }\n}\n\nexport function _init() {\n\n ChronoField.NANO_OF_SECOND = new ChronoField('NanoOfSecond', ChronoUnit.NANOS, ChronoUnit.SECONDS, ValueRange.of(0, 999999999));\n\n ChronoField.NANO_OF_DAY = new ChronoField('NanoOfDay', ChronoUnit.NANOS, ChronoUnit.DAYS, ValueRange.of(0, 86400 * 1000000000 - 1));\n\n ChronoField.MICRO_OF_SECOND = new ChronoField('MicroOfSecond', ChronoUnit.MICROS, ChronoUnit.SECONDS, ValueRange.of(0, 999999));\n\n ChronoField.MICRO_OF_DAY = new ChronoField('MicroOfDay', ChronoUnit.MICROS, ChronoUnit.DAYS, ValueRange.of(0, 86400 * 1000000 - 1));\n\n ChronoField.MILLI_OF_SECOND = new ChronoField('MilliOfSecond', ChronoUnit.MILLIS, ChronoUnit.SECONDS, ValueRange.of(0, 999));\n\n ChronoField.MILLI_OF_DAY = new ChronoField('MilliOfDay', ChronoUnit.MILLIS, ChronoUnit.DAYS, ValueRange.of(0, 86400 * 1000 - 1));\n\n ChronoField.SECOND_OF_MINUTE = new ChronoField('SecondOfMinute', ChronoUnit.SECONDS, ChronoUnit.MINUTES, ValueRange.of(0, 59));\n\n ChronoField.SECOND_OF_DAY = new ChronoField('SecondOfDay', ChronoUnit.SECONDS, ChronoUnit.DAYS, ValueRange.of(0, 86400 - 1));\n\n ChronoField.MINUTE_OF_HOUR = new ChronoField('MinuteOfHour', ChronoUnit.MINUTES, ChronoUnit.HOURS, ValueRange.of(0, 59));\n\n ChronoField.MINUTE_OF_DAY = new ChronoField('MinuteOfDay', ChronoUnit.MINUTES, ChronoUnit.DAYS, ValueRange.of(0, (24 * 60) - 1));\n\n ChronoField.HOUR_OF_AMPM = new ChronoField('HourOfAmPm', ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ValueRange.of(0, 11));\n\n ChronoField.CLOCK_HOUR_OF_AMPM = new ChronoField('ClockHourOfAmPm', ChronoUnit.HOURS, ChronoUnit.HALF_DAYS, ValueRange.of(1, 12));\n\n ChronoField.HOUR_OF_DAY = new ChronoField('HourOfDay', ChronoUnit.HOURS, ChronoUnit.DAYS, ValueRange.of(0, 23));\n\n ChronoField.CLOCK_HOUR_OF_DAY = new ChronoField('ClockHourOfDay', ChronoUnit.HOURS, ChronoUnit.DAYS, ValueRange.of(1, 24));\n\n ChronoField.AMPM_OF_DAY = new ChronoField('AmPmOfDay', ChronoUnit.HALF_DAYS, ChronoUnit.DAYS, ValueRange.of(0, 1));\n\n ChronoField.DAY_OF_WEEK = new ChronoField('DayOfWeek', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));\n\n ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH = new ChronoField('AlignedDayOfWeekInMonth', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));\n\n ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR = new ChronoField('AlignedDayOfWeekInYear', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));\n\n ChronoField.DAY_OF_MONTH = new ChronoField('DayOfMonth', ChronoUnit.DAYS, ChronoUnit.MONTHS, ValueRange.of(1, 28, 31), 'day');\n\n ChronoField.DAY_OF_YEAR = new ChronoField('DayOfYear', ChronoUnit.DAYS, ChronoUnit.YEARS, ValueRange.of(1, 365, 366));\n\n ChronoField.EPOCH_DAY = new ChronoField('EpochDay', ChronoUnit.DAYS, ChronoUnit.FOREVER, ValueRange.of(Math.floor(YearConstants.MIN_VALUE * 365.25), Math.floor(YearConstants.MAX_VALUE * 365.25)));\n\n ChronoField.ALIGNED_WEEK_OF_MONTH = new ChronoField('AlignedWeekOfMonth', ChronoUnit.WEEKS, ChronoUnit.MONTHS, ValueRange.of(1, 4, 5));\n\n ChronoField.ALIGNED_WEEK_OF_YEAR = new ChronoField('AlignedWeekOfYear', ChronoUnit.WEEKS, ChronoUnit.YEARS, ValueRange.of(1, 53));\n\n ChronoField.MONTH_OF_YEAR = new ChronoField('MonthOfYear', ChronoUnit.MONTHS, ChronoUnit.YEARS, ValueRange.of(1, 12), 'month');\n\n ChronoField.PROLEPTIC_MONTH = new ChronoField('ProlepticMonth', ChronoUnit.MONTHS, ChronoUnit.FOREVER, ValueRange.of(YearConstants.MIN_VALUE * 12, YearConstants.MAX_VALUE * 12 + 11));\n\n ChronoField.YEAR_OF_ERA = new ChronoField('YearOfEra', ChronoUnit.YEARS, ChronoUnit.FOREVER, ValueRange.of(1, YearConstants.MAX_VALUE, YearConstants.MAX_VALUE + 1));\n\n ChronoField.YEAR = new ChronoField('Year', ChronoUnit.YEARS, ChronoUnit.FOREVER, ValueRange.of(YearConstants.MIN_VALUE, YearConstants.MAX_VALUE), 'year');\n\n ChronoField.ERA = new ChronoField('Era', ChronoUnit.ERAS, ChronoUnit.FOREVER, ValueRange.of(0, 1));\n\n ChronoField.INSTANT_SECONDS = new ChronoField('InstantSeconds', ChronoUnit.SECONDS, ChronoUnit.FOREVER, ValueRange.of(MIN_SAFE_INTEGER, MAX_SAFE_INTEGER));\n\n ChronoField.OFFSET_SECONDS = new ChronoField('OffsetSeconds', ChronoUnit.SECONDS, ChronoUnit.FOREVER, ValueRange.of(-18 * 3600, 18 * 3600));\n\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\n/**\n * Common implementations of {@link TemporalQuery}.\n *\n * This class provides common implementations of {@link TemporalQuery}.\n * These queries are primarily used as optimizations, allowing the internals\n * of other objects to be extracted effectively. Note that application code\n * can also use the {@link from} method on most temporal\n * objects as a method reference matching the query interface, such as\n * {@link LocalDate::from} and {@link ZoneId::from}.\n *\n * There are two equivalent ways of using a {@link TemporalQuery}.\n * The first is to invoke the method on the interface directly.\n * The second is to use {@link TemporalAccessor#query}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = query.queryFrom(dateTime);\n * dateTime = dateTime.query(query);\n *\n * It is recommended to use the second approach, {@link query},\n * as it is a lot clearer to read in code.\n *\n */\nexport class TemporalQueries {\n\n /**\n * A strict query for the {@link ZoneId}.\n *\n * This queries a {@link TemporalAccessor} for the zone.\n * The zone is only returned if the date-time conceptually contains a {@link ZoneId}.\n * It will not be returned if the date-time only conceptually has an {@link ZoneOffset}.\n * Thus a {@link ZonedDateTime} will return the result of\n * {@link getZone}, but an {@link OffsetDateTime} will\n * return null.\n *\n * In most cases, applications should use {@link ZONE} as this query is too strict.\n *\n * The result from JDK classes implementing {@link TemporalAccessor} is as follows:\n * * * {@link LocalDate} returns null\n * * {@link LocalTime} returns null\n * * {@link LocalDateTime} returns null\n * * {@link ZonedDateTime} returns the associated zone\n * * {@link OffsetTime} returns null\n * * {@link OffsetDateTime} returns null\n * * {@link ChronoLocalDate} returns null\n * * {@link ChronoLocalDateTime} returns null\n * * {@link ChronoZonedDateTime} returns the associated zone\n * * {@link Era} returns null\n * * {@link DayOfWeek} returns null\n * * {@link Month} returns null\n * * {@link Year} returns null\n * * {@link YearMonth} returns null\n * * {@link MonthDay} returns null\n * * {@link ZoneOffset} returns null\n * * {@link Instant} returns null\n *\n * @return a query that can obtain the zone ID of a temporal, not null\n */\n static zoneId() {\n return TemporalQueries.ZONE_ID;\n }\n\n /**\n * A query for the {@link Chronology}.\n *\n * This queries a {@link TemporalAccessor} for the chronology.\n * If the target {@link TemporalAccessor} represents a date, or part of a date,\n * then it should return the chronology that the date is expressed in.\n * As a result of this definition, objects only representing time, such as\n * {@link LocalTime}, will return null.\n *\n * The result from js-joda classes implementing {@link TemporalAccessor} is as follows:\n *\n * * {@link LocalDate} returns * {@link IsoChronology.INSTANCE}\n * * {@link LocalTime} returns null (does not represent a date)\n * * {@link LocalDateTime} returns * {@link IsoChronology.INSTANCE}\n * * {@link ZonedDateTime} returns * {@link IsoChronology.INSTANCE}\n * * {@link OffsetTime} returns null (does not represent a date)\n * * {@link OffsetDateTime} returns * {@link IsoChronology.INSTANCE}\n * * {@link ChronoLocalDate} returns the associated chronology\n * * {@link ChronoLocalDateTime} returns the associated chronology\n * * {@link ChronoZonedDateTime} returns the associated chronology\n * * {@link Era} returns the associated chronology\n * * {@link DayOfWeek} returns null (shared across chronologies)\n * * {@link Month} returns * {@link IsoChronology.INSTANCE}\n * * {@link Year} returns * {@link IsoChronology.INSTANCE}\n * * {@link YearMonth} returns * {@link IsoChronology.INSTANCE}\n * * {@link MonthDay} returns null * {@link IsoChronology.INSTANCE}\n * * {@link ZoneOffset} returns null (does not represent a date)\n * * {@link Instant} returns null (does not represent a date)\n *\n * The method {@link Chronology#from} can be used as a\n * {@link TemporalQuery}\n * That method is equivalent to this query, except that it throws an\n * exception if a chronology cannot be obtained.\n *\n * @return {TemporalQuery} a query that can obtain the chronology of a temporal, not null\n */\n static chronology() {\n return TemporalQueries.CHRONO;\n }\n\n /**\n * A query for the smallest supported unit.\n *\n * This queries a {@link TemporalAccessor} for the time precision.\n * If the target {@link TemporalAccessor} represents a consistent or complete date-time,\n * date or time then this must return the smallest precision actually supported.\n * Note that fields such as {@link NANO_OF_DAY} and {@link NANO_OF_SECOND}\n * are defined to always return ignoring the precision, thus this is the only\n * way to find the actual smallest supported unit.\n * For example, were {@link GregorianCalendar} to implement {@link TemporalAccessor}\n * it would return a precision of {@link MILLIS}.\n *\n * The result from js-joda classes implementing {@link TemporalAccessor} is as follows:\n *\n * {@link LocalDate} returns {@link DAYS}\n * {@link LocalTime} returns {@link NANOS}\n * {@link LocalDateTime} returns {@link NANOS}\n * {@link ZonedDateTime} returns {@link NANOS}\n * {@link OffsetTime} returns {@link NANOS}\n * {@link OffsetDateTime} returns {@link NANOS}\n * {@link ChronoLocalDate} returns {@link DAYS}\n * {@link ChronoLocalDateTime} returns {@link NANOS}\n * {@link ChronoZonedDateTime} returns {@link NANOS}\n * {@link Era} returns {@link ERAS}\n * {@link DayOfWeek} returns {@link DAYS}\n * {@link Month} returns {@link MONTHS}\n * {@link Year} returns {@link YEARS}\n * {@link YearMonth} returns {@link MONTHS}\n * {@link MonthDay} returns null (does not represent a complete date or time)\n * {@link ZoneOffset} returns null (does not represent a date or time)\n * {@link Instant} returns {@link NANOS}\n *\n * @return a query that can obtain the precision of a temporal, not null\n */\n static precision() {\n return TemporalQueries.PRECISION;\n }\n\n /**\n * A lenient query for the {@link ZoneId}, falling back to the {@link ZoneOffset}.\n *\n * This queries a {@link TemporalAccessor} for the zone.\n * It first tries to obtain the zone, using {@link zoneId}.\n * If that is not found it tries to obtain the {@link offset}.\n *\n * In most cases, applications should use this query rather than {@link zoneId}.\n *\n * This query examines the {@link ChronoField#OFFSET_SECONDS}\n * field and uses it to create a {@link ZoneOffset}.\n *\n * The method {@link ZoneId#from} can be used as a\n * {@link TemporalQuery} via a method reference, {@link ZoneId::from}.\n * That method is equivalent to this query, except that it throws an\n * exception if a zone cannot be obtained.\n *\n * @return a query that can obtain the zone ID or offset of a temporal, not null\n */\n static zone() {\n return TemporalQueries.ZONE;\n }\n\n /**\n * A query for {@link ZoneOffset} returning null if not found.\n *\n * This returns a {@link TemporalQuery} that can be used to query a temporal\n * object for the offset. The query will return null if the temporal\n * object cannot supply an offset.\n *\n * The query implementation examines the {@link ChronoField#OFFSET_SECONDS}\n * field and uses it to create a {@link ZoneOffset}.\n *\n * The method {@link java.time.ZoneOffset#from} can be used as a\n * {@link TemporalQuery} via a method reference, {@link ZoneOffset::from}.\n * This query and {@link ZoneOffset::from} will return the same result if the\n * temporal object contains an offset. If the temporal object does not contain\n * an offset, then the method reference will throw an exception, whereas this\n * query will return null.\n *\n * @return a query that can obtain the offset of a temporal, not null\n */\n static offset() {\n return TemporalQueries.OFFSET;\n }\n\n /**\n * A query for {@link LocalDate} returning null if not found.\n *\n * This returns a {@link TemporalQuery} that can be used to query a temporal\n * object for the local date. The query will return null if the temporal\n * object cannot supply a local date.\n *\n * The query implementation examines the {@link ChronoField#EPOCH_DAY}\n * field and uses it to create a {@link LocalDate}.\n *\n * @return a query that can obtain the date of a temporal, not null\n */\n static localDate() {\n return TemporalQueries.LOCAL_DATE;\n }\n\n /**\n * A query for {@link LocalTime} returning null if not found.\n *\n * This returns a {@link TemporalQuery} that can be used to query a temporal\n * object for the local time. The query will return null if the temporal\n * object cannot supply a local time.\n *\n * The query implementation examines the {@link ChronoField#NANO_OF_DAY}\n * field and uses it to create a {@link LocalTime}.\n *\n * @return a query that can obtain the time of a temporal, not null\n */\n static localTime() {\n return TemporalQueries.LOCAL_TIME;\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 {UnsupportedTemporalTypeException} from '../errors';\n\nimport {ChronoField} from './ChronoField';\nimport {TemporalQueries} from './TemporalQueries';\n\nexport class TemporalAccessor {\n /**\n * Queries this date-time.\n *\n * This queries this date-time using the specified query strategy object.\n *\n * Queries are a key tool for extracting information from date-times.\n * They exists to externalize the process of querying, permitting different\n * approaches, as per the strategy design pattern.\n * Examples might be a query that checks if the date is the day before February 29th\n * in a leap year, or calculates the number of days to your next birthday.\n *\n * The most common query implementations are method references, such as\n * {@link LocalDate::from} and {@link ZoneId::from}.\n * Further implementations are on {@link TemporalQueries}.\n * Queries may also be defined by applications.\n *\n * @implSpec\n * Implementations of this method must behave as follows:\n *
\n if (query == TemporalQueries.zoneId()\n || query == TemporalQueries.chronology()\n || query == TemporalQueries.precision()) {\n return null;\n }\n return query.queryFrom(this);\n *\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\n * @throws ArithmeticException if numeric overflow occurs\n */\n query(query) {\n if (query === TemporalQueries.zoneId()\n || query === TemporalQueries.chronology()\n || query === TemporalQueries.precision()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Gets the value of the specified field as an `int`.\n *\n * This queries the date-time 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 the date-time cannot return the value, because the field is unsupported or for\n * some other reason, an exception will be thrown.\n *\n * ### Specification for implementors\n *\n * Implementations must check and handle all fields defined in {@link ChronoField}.\n * If the field is supported and has an `int` range, then the value of\n * the field must be returned.\n * If unsupported, then a {@link DateTimeException} must be thrown.\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.\n *\n * Implementations must not alter either this object.\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\n * @throws DateTimeException if the range of valid values for the field exceeds an `int`\n * @throws DateTimeException if the value is outside the range of valid values for the field\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 range of valid values for the specified field.\n *\n * All fields can be expressed as a `long` integer.\n * This method returns an object that describes the valid range for that value.\n * The value of this temporal object is used to enhance the accuracy of the returned range.\n * If the date-time cannot return the range, because the field is unsupported or for\n * some other reason, an exception will be thrown.\n *\n * Note that the result only describes the minimum and maximum valid values\n * and it is important not to read too much into them. For example, there\n * could be values within the range that are invalid for the field.\n *\n * ### Specification for implementors\n *\n * Implementations must check and handle all fields defined in {@link ChronoField}.\n * If the field is supported, then the range of the field must be returned.\n * If unsupported, then a {@link DateTimeException} must be thrown.\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 *\n * Implementations must not alter either this object.\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 */\n range(field) {\n if (field instanceof ChronoField) {\n if (this.isSupported(field)) {\n return field.range();\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.rangeRefinedBy(this);\n }\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 {TemporalAccessor} from './TemporalAccessor';\n\n/**\n * Framework-level interface defining read-write access to a temporal object,\n * such as a date, time, offset or some combination of these.\n *\n * This is the base interface type for date, time and offset objects that\n * are complete enough to be manipulated using plus and minus.\n * It is implemented by those classes that can provide and manipulate information\n * as fields (see {@link TemporalField}) or queries (see {@link TemporalQuery}).\n * See {@link TemporalAccessor} for the read-only version of this interface.\n *\n * Most date and time information can be represented as a number.\n * These are modeled using {@link TemporalField} with the number held using\n * a `long` to handle large values. Year, month and day-of-month are\n * simple examples of fields, but they also include instant and offsets.\n * See {@link ChronoField} for the standard set of fields.\n *\n * Two pieces of date/time information cannot be represented by numbers,\n * the {@link Chronology} and the {@link ZoneId}.\n * These can be accessed using the static methods defined on {@link TemporalQueries}.\n *\n * This interface is a framework-level interface that should not be widely\n * used in application code. Instead, applications should create and pass\n * around instances of concrete types, such as {@link LocalDate}.\n * There are many reasons for this, part of which is that implementations\n * of this interface may be in calendar systems other than ISO.\n * See {@link ChronoLocalDate} for a fuller discussion of the issues.\n *\n * ### When to implement\n *\n * A class should implement this interface if it meets three criteria:\n *\n * * it provides access to date/time/offset information, as per {@link TemporalAccessor}\n * * the set of fields are contiguous from the largest to the smallest\n * * the set of fields are complete, such that no other field is needed to define the\n * valid range of values for the fields that are represented\n *\n * Four examples make this clear:\n *\n * * {@link LocalDate} implements this interface as it represents a set of fields\n * that are contiguous from days to forever and require no external information to determine\n * the validity of each date. It is therefore able to implement plus/minus correctly.\n * * {@link LocalTime} implements this interface as it represents a set of fields\n * that are contiguous from nanos to within days and require no external information to determine\n * validity. It is able to implement plus/minus correctly, by wrapping around the day.\n * * {@link MonthDay}, the combination of month-of-year and day-of-month, does not implement\n * this interface. While the combination is contiguous, from days to months within years,\n * the combination does not have sufficient information to define the valid range of values\n * for day-of-month. As such, it is unable to implement plus/minus correctly.\n * * The combination day-of-week and day-of-month (\"Friday the 13th\") should not implement\n * this interface. It does not represent a contiguous set of fields, as days to weeks overlaps\n * days to months.\n *\n * @interface\n */\nexport class Temporal extends TemporalAccessor {}\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 {abstractMethodFail} from '../assert';\nimport {Enum} from '../Enum';\n\n\n/**\n * Strategy for querying a temporal object.\n *\n * Queries are a key tool for extracting information from temporal objects.\n * They exist to externalize the process of querying, permitting different\n * approaches, as per the strategy design pattern.\n * Examples might be a query that checks if the date is the day before February 29th\n * in a leap year, or calculates the number of days to your next birthday.\n *\n * The {@link TemporalField} interface provides another mechanism for querying\n * temporal objects. That interface is limited to returning a `long`.\n * By contrast, queries can return any type.\n *\n * There are two equivalent ways of using a {@link TemporalQuery}.\n * The first is to invoke the method on this interface directly.\n * The second is to use {@link TemporalAccessor#query}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisQuery.queryFrom(temporal);\n * temporal = temporal.query(thisQuery);\n *\n * It is recommended to use the second approach, {@link query},\n * as it is a lot clearer to read in code.\n *\n * The most common implementations are method references, such as\n * {@link LocalDate::from} and {@link ZoneId::from}.\n * Further implementations are on {@link TemporalQueries}.\n * Queries may also be defined by applications.\n *\n * ### Specification for implementors\n *\n * This interface places no restrictions on the mutability of implementations,\n * however immutability is strongly recommended.\n *\n * @interface\n */\nexport class TemporalQuery extends Enum {\n /**\n * Queries the specified temporal object.\n *\n * This queries the specified temporal object to return an object using the logic\n * encapsulated in the implementing class.\n * Examples might be a query that checks if the date is the day before February 29th\n * in a leap year, or calculates the number of days to your next birthday.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link TemporalAccessor#query}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisQuery.queryFrom(temporal);\n * temporal = temporal.query(thisQuery);\n *\n * It is recommended to use the second approach, {@link query},\n * as it is a lot clearer to read in code.\n *\n * ### Specification for implementors\n *\n * The implementation must take the input object and query it.\n * The implementation defines the logic of the query and is responsible for\n * documenting that logic.\n * It may use any method on {@link TemporalAccessor} to determine the result.\n * The input object must not be altered.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {TemporalAccessor} temporal the temporal object to query, not null\n * @return the queried value, may return null to indicate not found\n * @throws DateTimeException if unable to query\n * @throws ArithmeticException if numeric overflow occurs\n */\n // eslint-disable-next-line no-unused-vars\n queryFrom(temporal){\n abstractMethodFail('queryFrom');\n }\n\n}\n\n/**\n * Factory to create something similar to the JSR-310 {TemporalQuery} interface, takes a function and returns a new TemporalQuery object that presents that function\n * as the queryFrom() function.\n * @param name for the underlying Enum\n * @param queryFromFunction\n */\nexport function createTemporalQuery(name, queryFromFunction) {\n class ExtendedTemporalQuery extends TemporalQuery {\n\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 * @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, UnsupportedTemporalTypeException, NullPointerException} from './errors';\nimport {MathUtil} from './MathUtil';\nimport {assert, requireNonNull} from './assert';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {IllegalArgumentException} from './errors';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\n\n/**\n * ### Static properties of Class {@link DayOfWeek}\n *\n * DayOfWeek.MONDAY,\n * DayOfWeek.TUESDAY,\n * DayOfWeek.WEDNESDAY,\n * DayOfWeek.THURSDAY,\n * DayOfWeek.FRIDAY,\n * DayOfWeek.SATURDAY,\n * DayOfWeek.SUNDAY\n *\n */\nexport class DayOfWeek extends Temporal {\n\n /**\n *\n * @param {number} ordinal\n * @param {string} name\n * @private\n */\n constructor(ordinal, name){\n super();\n this._ordinal = ordinal;\n this._name = name;\n }\n\n /**\n *\n * @returns {number}\n */\n ordinal(){\n return this._ordinal;\n }\n\n /**\n *\n * @returns {string}\n */\n name(){\n return this._name;\n }\n\n /**\n *\n * @returns {DayOfWeek[]}\n */\n static values() {\n return ENUMS.slice();\n }\n\n /**\n *\n * @param {string} name\n * @returns {DayOfWeek}\n */\n static valueOf(name) {\n let ordinal = 0;\n for(ordinal; ordinal < ENUMS.length; ordinal++){\n if(ENUMS[ordinal].name() === name){\n break;\n }\n }\n return DayOfWeek.of(ordinal+1);\n }\n\n /**\n * Obtains an instance of {@link DayOfWeek} from an `int` value.\n *\n * {@link DayOfWeek} is an enum representing the 7 days of the week.\n * This factory allows the enum to be obtained from the `int` value.\n * The `int` value follows the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).\n *\n * @param {!number} dayOfWeek the day-of-week to represent, from 1 (Monday) to 7 (Sunday)\n * @return {DayOfWeek} the day-of-week singleton, not null\n * @throws DateTimeException if the day-of-week is invalid\n */\n static of(dayOfWeek) {\n if (dayOfWeek < 1 || dayOfWeek > 7) {\n throw new DateTimeException('Invalid value for DayOfWeek: ' + dayOfWeek);\n }\n return ENUMS[dayOfWeek - 1];\n }\n\n /**\n * Obtains an instance of {@link DayOfWeek} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link DayOfWeek}.\n *\n * The conversion extracts the {@link ChronoField#DAY_OF_WEEK} field.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link DayOfWeek::from}.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {DayOfWeek} the day-of-week, not null\n * @throws DateTimeException if unable to convert to a {@link DayOfWeek}\n */\n static from(temporal) {\n assert(temporal != null, 'temporal', NullPointerException);\n if (temporal instanceof DayOfWeek) {\n return temporal;\n }\n try {\n return DayOfWeek.of(temporal.get(ChronoField.DAY_OF_WEEK));\n } catch (ex) {\n if(ex instanceof DateTimeException) {\n throw new DateTimeException('Unable to obtain DayOfWeek from TemporalAccessor: ' +\n temporal + ', type ' + (temporal.constructor != null ? temporal.constructor.name : ''), ex);\n } else {\n throw ex;\n }\n }\n }\n\n /**\n * Gets the day-of-week `int` value.\n *\n * The values are numbered following the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).\n * See {@link WeekFields#dayOfWeek} for localized week-numbering.\n *\n * @return {number} the day-of-week, from 1 (Monday) to 7 (Sunday)\n */\n value() {\n return this._ordinal + 1;\n }\n\n /**\n * Gets the textual representation, such as 'Mon' or 'Friday'.\n *\n * This returns the textual name used to identify the day-of-week.\n * The parameters control the length of the returned text and the locale.\n *\n * If no textual mapping is found then the numeric value (see {@link getValue}) 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 getDisplayName(style, locale) {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented yet!');\n // return new DateTimeFormatterBuilder().appendText(ChronoField.DAY_OF_WEEK, style).toFormatter(locale).format(this);\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this day-of-week can be queried for the specified field.\n * If false, then calling the {@link range} and\n * {@link get} methods will throw an exception.\n *\n * If the field is {@link ChronoField#DAY_OF_WEEK} then\n * this method returns true.\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 `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 day-of-week, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_WEEK;\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 day-of-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 * If the field is {@link ChronoField#DAY_OF_WEEK} then the\n * range of the day-of-week, from 1 to 7, will be returned.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link 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 */\n range(field) {\n if (field === ChronoField.DAY_OF_WEEK) {\n return field.range();\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this day-of-week as an `int`.\n *\n * This queries this day-of-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 * If the field is {@link ChronoField#DAY_OF_WEEK} then the\n * value of the day-of-week, from 1 to 7, will be returned.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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, within the valid range of values\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws DateTimeException if the range of valid values for the field exceeds an `int`\n * @throws DateTimeException if the value is outside the range of valid values for the field\n * @throws ArithmeticException if numeric overflow occurs\n */\n get(field) {\n if (field === ChronoField.DAY_OF_WEEK) {\n return this.value();\n }\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-week as a `long`.\n *\n * This queries this day-of-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 * If the field is {@link ChronoField#DAY_OF_WEEK} then the\n * value of the day-of-week, from 1 to 7, will be returned.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field === ChronoField.DAY_OF_WEEK) {\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 day-of-week that is the specified number of days after this one.\n *\n * The calculation rolls around the end of the week from Sunday to Monday.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to add, positive or negative\n * @return {DayOfWeek} the resulting day-of-week, not null\n */\n plus(days) {\n const amount = MathUtil.floorMod(days, 7);\n return ENUMS[MathUtil.floorMod(this._ordinal + (amount + 7), 7)];\n }\n\n /**\n * Returns the day-of-week that is the specified number of days before this one.\n *\n * The calculation rolls around the start of the year from Monday to Sunday.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} days - the days to subtract, positive or negative\n * @return {DayOfWeek} the resulting day-of-week, not null\n */\n minus(days) {\n return this.plus(-1 * MathUtil.floorMod(days, 7));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-week using the specified query.\n *\n * This queries this day-of-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 if (query === TemporalQueries.precision()) {\n return ChronoUnit.DAYS;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() || query === TemporalQueries.chronology() ||\n query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n assert(query != null, 'query', NullPointerException);\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-week.\n *\n * This returns a temporal object of the same observable type as the input\n * with the day-of-week changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#DAY_OF_WEEK} as the field.\n * Note that this adjusts forwards or backwards within a Monday to Sunday week.\n * See {@link WeekFields#dayOfWeek} for localized week start days.\n * See {@link TemporalAdjusters} for other adjusters\n * with more control, such as `next(MONDAY)`.\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 = thisDayOfWeek.adjustInto(temporal);\n * temporal = temporal.with(thisDayOfWeek);\n *\n *\n * For example, given a date that is a Wednesday, the following are output:\n *
\n * dateOnWed.with(MONDAY); // two days earlier\n * dateOnWed.with(TUESDAY); // one day earlier\n * dateOnWed.with(WEDNESDAY); // same date\n * dateOnWed.with(THURSDAY); // one day later\n * dateOnWed.with(FRIDAY); // two days later\n * dateOnWed.with(SATURDAY); // three days later\n * dateOnWed.with(SUNDAY); // four days later\n *\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjusters} 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 return temporal.with(ChronoField.DAY_OF_WEEK, this.value());\n }\n\n /**\n *\n * @returns {boolean}\n */\n equals(other){\n return this === other;\n }\n\n /**\n *\n * @returns {string}\n */\n toString(){\n return this._name;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nlet ENUMS;\n\nexport function _init() {\n DayOfWeek.MONDAY = new DayOfWeek(0, 'MONDAY');\n DayOfWeek.TUESDAY = new DayOfWeek(1, 'TUESDAY');\n DayOfWeek.WEDNESDAY = new DayOfWeek(2, 'WEDNESDAY');\n DayOfWeek.THURSDAY = new DayOfWeek(3, 'THURSDAY');\n DayOfWeek.FRIDAY = new DayOfWeek(4, 'FRIDAY');\n DayOfWeek.SATURDAY = new DayOfWeek(5, 'SATURDAY');\n DayOfWeek.SUNDAY = new DayOfWeek(6, 'SUNDAY');\n\n DayOfWeek.FROM = createTemporalQuery('DayOfWeek.FROM', (temporal) => {\n return DayOfWeek.from(temporal);\n });\n\n ENUMS = [\n DayOfWeek.MONDAY,\n DayOfWeek.TUESDAY,\n DayOfWeek.WEDNESDAY,\n DayOfWeek.THURSDAY,\n DayOfWeek.FRIDAY,\n DayOfWeek.SATURDAY,\n DayOfWeek.SUNDAY\n ];\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 {MathUtil} from './MathUtil';\n\n/**\n * @private\n */\nexport class StringUtil {\n\n /**\n *\n * @param {string} text\n * @param {string} pattern\n * @return {boolean}\n */\n static startsWith(text, pattern){\n return text.indexOf(pattern) === 0;\n }\n\n /**\n *\n * @param {string} text\n * @returns {number}\n */\n static hashCode(text) {\n const len = text.length;\n if (len === 0) {\n return 0;\n }\n\n let hash = 0;\n for (let i = 0; i < len; i++) {\n const chr = text.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return MathUtil.smi(hash);\n }\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 {abstractMethodFail} from './assert';\nimport {DateTimeException} from './errors';\n\nimport {StringUtil} from './StringUtil';\n\nimport {Instant} from './Instant';\n\nexport class ZoneId {\n /**\n * Gets the system default time-zone.\n *\n * @return {ZoneId} the zone ID, not null\n */\n static systemDefault() {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation');\n }\n\n /**\n * Gets the set of available zone IDs.\n *\n * This set includes the string form of all available region-based IDs.\n * Offset-based zone IDs are not included in the returned set.\n * The ID can be passed to {@link of} to create a {@link ZoneId}.\n *\n * The set of zone IDs can increase over time, although in a typical application\n * the set of IDs is fixed. Each call to this method is thread-safe.\n *\n * @return {string[]} a modifiable copy of the set of zone IDs, not null\n */\n static getAvailableZoneIds() {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation');\n }\n\n /**\n * Obtains an instance of {@link ZoneId} from an ID ensuring that the\n * ID is valid and available for use.\n *\n * This method parses the ID producing a {@link ZoneId} or {@link ZoneOffset}.\n * A {@link ZoneOffset} is returned if the ID is 'Z', or starts with '+' or '-'.\n * The result will always be a valid ID for which {@link ZoneRules} can be obtained.\n *\n * Parsing matches the zone ID step by step as follows.\n *\n * * If the zone ID equals 'Z', the result is {@link ZoneOffset.UTC}.\n * * If the zone ID consists of a single letter, the zone ID is invalid\n * and {@link DateTimeException} is thrown.\n * * If the zone ID starts with '+' or '-', the ID is parsed as a\n * {@link ZoneOffset} using {@link ZoneOffset#of}.\n * * If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a {@link ZoneId}\n * with the same ID and rules equivalent to {@link ZoneOffset.UTC}.\n * * If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'\n * then the ID is a prefixed offset-based ID. The ID is split in two, with\n * a two or three letter prefix and a suffix starting with the sign.\n * The suffix is parsed as a {@link ZoneOffset}.\n * The result will be a {@link ZoneId} with the specified UTC/GMT/UT prefix\n * and the normalized offset ID as per {@link ZoneOffset#getId}.\n * The rules of the returned {@link ZoneId} will be equivalent to the\n * parsed {@link ZoneOffset}.\n * * All other IDs are parsed as region-based zone IDs. Region IDs must\n * match the regular expression `[A-Za-z][A-Za-z0-9~/._+-]+`,\n * otherwise a {@link DateTimeException} is thrown. If the zone ID is not\n * in the configured set of IDs, {@link ZoneRulesException} is thrown.\n * The detailed format of the region ID depends on the group supplying the data.\n * The default set of data is supplied by the IANA Time Zone Database (TZDB).\n * This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.\n * This is compatible with most IDs from {@link java.util.TimeZone}.\n *\n * @param {string} zoneId the time-zone ID, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if the zone ID has an invalid format\n * @throws ZoneRulesException if the zone ID is a region ID that cannot be found\n */\n static of(zoneId) {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation' + zoneId);\n }\n\n /**\n * Obtains an instance of {@link ZoneId} wrapping an offset.\n *\n * If the prefix is 'GMT', 'UTC', or 'UT' a {@link ZoneId}\n * with the prefix and the non-zero offset is returned.\n * If the prefix is empty `''` the {@link ZoneOffset} is returned.\n *\n * @param {string} prefix the time-zone ID, not null\n * @param {ZoneOffset} offset the offset, not null\n * @return {ZoneId} the zone ID, not null\n * @throws IllegalArgumentException if the prefix is not one of\n * 'GMT', 'UTC', or 'UT', or ''\n */\n static ofOffset(prefix, offset) {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation' + prefix + offset);\n }\n\n\n /**\n * Obtains an instance of {@link ZoneId} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link ZoneId}.\n *\n * The conversion will try to obtain the zone in a way that favours region-based\n * zones over offset-based zones using {@link TemporalQueries#zone}.\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 ZoneId::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if unable to convert to a {@link ZoneId}\n */\n static from(temporal) {\n // Find implementation at {@link ZoneIdFactory}\n throw new DateTimeException('not supported operation' + temporal);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the unique time-zone ID.\n *\n * This ID uniquely defines this object.\n * The format of an offset based ID is defined by {@link ZoneOffset#getId}.\n *\n * @return {String} the time-zone unique ID, not null\n */\n id(){\n abstractMethodFail('ZoneId.id');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the time-zone rules for this ID allowing calculations to be performed.\n *\n * The rules provide the functionality associated with a time-zone,\n * such as finding the offset for a given instant or local date-time.\n *\n * A time-zone can be invalid if it is deserialized in a Java Runtime which\n * does not have the same rules loaded as the Java Runtime that stored it.\n * In this case, calling this method will throw a {@link ZoneRulesException}.\n *\n * The rules are supplied by {@link ZoneRulesProvider}. An advanced provider may\n * support dynamic updates to the rules without restarting the Java Runtime.\n * If so, then the result of this method may change over time.\n * Each individual call will be still remain thread-safe.\n *\n * {@link ZoneOffset} will always return a set of rules where the offset never changes.\n *\n * @return {!ZoneRules} the rules, not null\n * @throws ZoneRulesException if no rules are available for this ID\n */\n rules(){\n abstractMethodFail('ZoneId.rules');\n }\n\n /**\n * Normalizes the time-zone ID, returning a {@link ZoneOffset} where possible.\n *\n * The returns a normalized {@link ZoneId} that can be used in place of this ID.\n * The result will have {@link ZoneRules} equivalent to those returned by this object,\n * however the ID returned by {@link getId} may be different.\n *\n * The normalization checks if the rules of this {@link ZoneId} have a fixed offset.\n * If they do, then the {@link ZoneOffset} equal to that offset is returned.\n * Otherwise `this` is returned.\n *\n * @return {ZoneId} the time-zone unique ID, not null\n */\n normalized() {\n const rules = this.rules();\n if (rules.isFixedOffset()) {\n return rules.offset(Instant.EPOCH);\n }\n //try {\n //} catch (ZoneRulesException ex) {\n // // ignore invalid objects\n //}\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this time-zone ID is equal to another time-zone ID.\n *\n * The comparison is based on the ID.\n *\n * @param {*} other the object to check, null returns false\n * @return {boolean} true if this is equal to the other time-zone ID\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ZoneId) {\n return this.id() === other.id();\n }\n return false;\n }\n\n /**\n * A hash code for this time-zone ID.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return StringUtil.hashCode(this.id());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this zone as a string, using the ID.\n *\n * @return {string} a string representation of this time-zone ID, not null\n */\n toString() {\n return this.id();\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\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 {requireNonNull, abstractMethodFail} from '../assert';\n\nimport {Duration} from '../Duration';\nimport {Instant} from '../Instant';\n\nexport class ZoneRules {\n\n /**\n * Obtains an instance of {@link ZoneRules} that always uses the same offset.\n *\n * The returned rules always have the same offset.\n *\n * @param {ZoneOffset} offset - the offset, not null\n * @return {ZoneRules} the zone rules, not null\n */\n static of(offset) {\n requireNonNull(offset, 'offset');\n return new Fixed(offset);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Checks of the zone rules are fixed, such that the offset never varies.\n *\n * @return {boolean} true if the time-zone is fixed and the offset never changes\n */\n isFixedOffset(){\n abstractMethodFail('ZoneRules.isFixedOffset');\n }\n\n //-----------------------------------------------------------------------\n\n /**\n *\n * @param instantOrLocalDateTime\n * @returns {ZoneOffset}\n */\n offset(instantOrLocalDateTime){\n if(instantOrLocalDateTime instanceof Instant){\n return this.offsetOfInstant(instantOrLocalDateTime);\n } else {\n return this.offsetOfLocalDateTime(instantOrLocalDateTime);\n }\n }\n\n /**\n * Gets the offset applicable at the specified instant in these rules.\n *\n * The mapping from an instant to an offset is simple, there is only\n * one valid offset for each instant.\n * This method returns that offset.\n *\n * @param {Instant} instant - the instant to find the offset for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n offsetOfInstant(instant){\n abstractMethodFail('ZoneRules.offsetInstant');\n }\n\n /**\n * Gets the offset applicable at the specified epochMilli in these rules.\n *\n * The method is for javascript performance optimisation.\n *\n * @param {number} epochMilli - the epoch millisecond to find the offset for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n offsetOfEpochMilli(epochMilli){\n abstractMethodFail('ZoneRules.offsetOfEpochMilli');\n }\n\n\n /**\n * Gets a suitable offset for the specified local date-time in these rules.\n *\n * The mapping from a local date-time to an offset is not straightforward.\n * There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from \"winter\" to \"summer\".\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from \"summer\" to \"winter\".\n * In an overlap there are local date-time values with two valid offsets.\n *\n * Thus, for any given local date-time there can be zero, one or two valid offsets.\n * This method returns the single offset in the Normal case, and in the Gap or Overlap\n * case it returns the offset before the transition.\n *\n * Since, in the case of Gap and Overlap, the offset returned is a \"best\" value, rather\n * than the \"correct\" value, it should be treated with care. Applications that care\n * about the correct offset should use a combination of this method,\n * {@link getValidOffsets} and {@link getTransition}.\n *\n * @param {LocalDateTime} localDateTime - the local date-time to query, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the best available offset for the local date-time, not null\n */\n // eslint-disable-next-line no-unused-vars\n offsetOfLocalDateTime(localDateTime){\n abstractMethodFail('ZoneRules.offsetLocalDateTime');\n }\n\n /**\n * Gets the offset applicable at the specified local date-time in these rules.\n *\n * The mapping from a local date-time to an offset is not straightforward.\n * There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from \"winter\" to \"summer\".\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from \"summer\" to \"winter\".\n * In an overlap there are local date-time values with two valid offsets.\n *\n * Thus, for any given local date-time there can be zero, one or two valid offsets.\n * This method returns that list of valid offsets, which is a list of size 0, 1 or 2.\n * In the case where there are two offsets, the earlier offset is returned at index 0\n * and the later offset at index 1.\n *\n * There are various ways to handle the conversion from a {@link LocalDateTime}.\n * One technique, using this method, would be:\n *
\n * List\n *\n * In theory, it is possible for there to be more than two valid offsets.\n * This would happen if clocks to be put back more than once in quick succession.\n * This has never happened in the history of time-zones and thus has no special handling.\n * However, if it were to happen, then the list would return more than 2 entries.\n *\n * @param {LocalDateTime} localDateTime - the local date-time to query for valid offsets, not null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset[]} the list of valid offsets, may be immutable, not null\n */\n // eslint-disable-next-line no-unused-vars\n validOffsets(localDateTime){\n abstractMethodFail('ZoneRules.validOffsets');\n }\n\n /**\n * Gets the offset transition applicable at the specified local date-time in these rules.\n *\n * The mapping from a local date-time to an offset is not straightforward.\n * There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from \"winter\" to \"summer\".\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from \"summer\" to \"winter\".\n * In an overlap there are local date-time values with two valid offsets.\n *\n * A transition is used to model the cases of a Gap or Overlap.\n * The Normal case will return null.\n *\n * There are various ways to handle the conversion from a {@link LocalDateTime}.\n * One technique, using this method, would be:\n *validOffsets = rules.getOffset(localDT);\n * if (validOffsets.size() == 1) {\n * // Normal case: only one valid offset\n * zoneOffset = validOffsets.get(0);\n * } else {\n * // Gap or Overlap: determine what to do from transition (which will be non-null)\n * ZoneOffsetTransition trans = rules.getTransition(localDT);\n * }\n *
\n * ZoneOffsetTransition trans = rules.getTransition(localDT);\n * if (trans != null) {\n * // Gap or Overlap: determine what to do from transition\n * } else {\n * // Normal case: only one valid offset\n * zoneOffset = rule.getOffset(localDT);\n * }\n *\n *\n * @param {LocalDateTime} localDateTime the local date-time to query for offset transition, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffsetTransition} the offset transition, null if the local date-time is not in transition\n */\n // eslint-disable-next-line no-unused-vars\n transition(localDateTime){\n abstractMethodFail('ZoneRules.transition');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the standard offset for the specified instant in this zone.\n *\n * This provides access to historic information on how the standard offset\n * has changed over time.\n * The standard offset is the offset before any daylight saving time is applied.\n * This is typically the offset applicable during winter.\n *\n * @param {Instant} instant - the instant to find the offset information for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffset} the standard offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n standardOffset(instant){\n abstractMethodFail('ZoneRules.standardOffset');\n }\n\n /**\n * Gets the amount of daylight savings in use for the specified instant in this zone.\n *\n * This provides access to historic information on how the amount of daylight\n * savings has changed over time.\n * This is the difference between the standard offset and the actual offset.\n * Typically the amount is zero during winter and one hour during summer.\n * Time-zones are second-based, so the nanosecond part of the duration will be zero.\n *\n * @param {Instant} instant - the instant to find the daylight savings for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {Duration} the difference between the standard and actual offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n daylightSavings(instant){\n abstractMethodFail('ZoneRules.daylightSavings');\n // default {\n // ZoneOffset standardOffset = getStandardOffset(instant);\n // ZoneOffset actualOffset = getOffset(instant);\n // return actualOffset.toDuration().minus(standardOffset.toDuration()).normalized();\n // }\n }\n\n /**\n * Checks if the specified instant is in daylight savings.\n *\n * This checks if the standard and actual offsets are the same at the specified instant.\n *\n * @param {Instant} instant - the instant to find the offset information for, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {boolean} the standard offset, not null\n */\n // eslint-disable-next-line no-unused-vars\n isDaylightSavings(instant) {\n abstractMethodFail('ZoneRules.isDaylightSavings');\n // default {\n // return (getStandardOffset(instant).equals(getOffset(instant)) == false);\n // }\n }\n\n /**\n * Checks if the offset date-time is valid for these rules.\n *\n * To be valid, the local date-time must not be in a gap and the offset\n * must match the valid offsets.\n *\n * @param {LocalDateTime} localDateTime - the date-time to check, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @param {ZoneOffset} offset - the offset to check, null returns false\n * @return {boolean} true if the offset date-time is valid for these rules\n */\n // eslint-disable-next-line no-unused-vars\n isValidOffset(localDateTime, offset){\n abstractMethodFail('ZoneRules.isValidOffset');\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the next transition after the specified instant.\n *\n * This returns details of the next transition after the specified instant.\n * For example, if the instant represents a point where \"Summer\" daylight savings time\n * applies, then the method will return the transition to the next \"Winter\" time.\n *\n * @param {Instant} instant - the instant to get the next transition after, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffsetTransition} the next transition after the specified instant, null if this is after the last transition\n */\n // eslint-disable-next-line no-unused-vars\n nextTransition(instant){\n abstractMethodFail('ZoneRules.nextTransition');\n }\n\n /**\n * Gets the previous transition before the specified instant.\n *\n * This returns details of the previous transition after the specified instant.\n * For example, if the instant represents a point where \"summer\" daylight saving time\n * applies, then the method will return the transition from the previous \"winter\" time.\n *\n * @param {Instant} instant - the instant to get the previous transition after, not null, but null\n * may be ignored if the rules have a single offset for all instants\n * @return {ZoneOffsetTransition} the previous transition after the specified instant, null if this is before the first transition\n */\n // eslint-disable-next-line no-unused-vars\n previousTransition(instant){\n abstractMethodFail('ZoneRules.previousTransition');\n }\n\n /**\n * Gets the complete list of fully defined transitions.\n *\n * The complete set of transitions for this rules instance is defined by this method\n * and {@link getTransitionRules}. This method returns those transitions that have\n * been fully defined. These are typically historical, but may be in the future.\n *\n * The list will be empty for fixed offset rules and for any time-zone where there has\n * only ever been a single offset. The list will also be empty if the transition rules are unknown.\n *\n * @return {ZoneOffsetTransition[]} an immutable list of fully defined transitions, not null\n */\n transitions(){\n abstractMethodFail('ZoneRules.transitions');\n }\n\n /**\n * Gets the list of transition rules for years beyond those defined in the transition list.\n *\n * The complete set of transitions for this rules instance is defined by this method\n * and {@link getTransitions}. This method returns instances of {@link ZoneOffsetTransitionRule}\n * that define an algorithm for when transitions will occur.\n *\n * For any given {@link ZoneRules}, this list contains the transition rules for years\n * beyond those years that have been fully defined. These rules typically refer to future\n * daylight saving time rule changes.\n *\n * If the zone defines daylight savings into the future, then the list will normally\n * be of size two and hold information about entering and exiting daylight savings.\n * If the zone does not have daylight savings, or information about future changes\n * is uncertain, then the list will be empty.\n *\n * The list will be empty for fixed offset rules and for any time-zone where there is no\n * daylight saving time. The list will also be empty if the transition rules are unknown.\n *\n * @return {ZoneOffsetTransitionRule[]} an immutable list of transition rules, not null\n */\n transitionRules(){\n abstractMethodFail('ZoneRules.transitionRules');\n }\n\n toString(){\n abstractMethodFail('ZoneRules.toString');\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n\n\nclass Fixed extends ZoneRules{\n /**\n *\n * @param {ZoneOffset} offset\n * @private\n */\n constructor(offset){\n super();\n this._offset = offset;\n }\n\n isFixedOffset(){\n return true;\n }\n\n offsetOfInstant(){\n return this._offset;\n }\n\n offsetOfEpochMilli(){\n return this._offset;\n }\n\n offsetOfLocalDateTime(){\n return this._offset;\n }\n\n validOffsets(){\n return [this._offset];\n }\n\n transition(){\n return null;\n }\n\n standardOffset(){\n return this._offset;\n }\n\n daylightSavings(){\n return Duration.ZERO;\n }\n\n isDaylightSavings(){\n return false;\n }\n\n /**\n *\n * @param {LocalDateTime} localDateTime\n * @param {ZoneOffset} offset\n * @return {boolean}\n */\n isValidOffset(localDateTime, offset) {\n return this._offset.equals(offset);\n }\n\n nextTransition(){\n return null;\n }\n\n previousTransition(){\n return null;\n }\n\n transitions(){\n return [];\n }\n\n transitionRules(){\n return [];\n }\n\n //-----------------------------------------------------------------------\n /**\n *\n * @param other\n * @returns {boolean}\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof Fixed) {\n return this._offset.equals(other._offset);\n }\n return false;\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'FixedRules:' + this._offset.toString();\n }\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 {requireNonNull} from './assert';\nimport {DateTimeException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {LocalTime} from './LocalTime';\nimport {ZoneId} from './ZoneId';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\n\nimport {ZoneRules} from './zone/ZoneRules';\n\nconst SECONDS_CACHE = {};\nconst ID_CACHE = {};\n\n/**\n *\n * ### Static properties of Class {@link LocalDate}\n *\n * ZoneOffset.MAX_SECONDS = 18 * LocalTime.SECONDS_PER_HOUR;\n *\n * ZoneOffset.UTC = ZoneOffset.ofTotalSeconds(0);\n *\n * ZoneOffset.MIN = ZoneOffset.ofTotalSeconds(-ZoneOffset.MAX_SECONDS);\n *\n * ZoneOffset.MAX = ZoneOffset.ofTotalSeconds(ZoneOffset.MAX_SECONDS);\n *\n */\nexport class ZoneOffset extends ZoneId {\n /**\n *\n * @param {number} totalSeconds\n * @private\n */\n constructor(totalSeconds){\n super();\n ZoneOffset._validateTotalSeconds(totalSeconds);\n this._totalSeconds = MathUtil.safeToInt(totalSeconds);\n this._rules = ZoneRules.of(this);\n this._id = ZoneOffset._buildId(totalSeconds);\n }\n\n /**\n *\n * @returns {number}\n */\n totalSeconds() {\n return this._totalSeconds;\n }\n\n /**\n *\n * @returns {string}\n */\n id() {\n return this._id;\n }\n\n /**\n *\n * @param {number} totalSeconds\n * @returns {string}\n */\n static _buildId(totalSeconds) {\n if (totalSeconds === 0) {\n return 'Z';\n } else {\n const absTotalSeconds = Math.abs(totalSeconds);\n const absHours = MathUtil.intDiv(absTotalSeconds, LocalTime.SECONDS_PER_HOUR);\n const absMinutes = MathUtil.intMod(MathUtil.intDiv(absTotalSeconds, LocalTime.SECONDS_PER_MINUTE), LocalTime.MINUTES_PER_HOUR);\n let buf = '' + (totalSeconds < 0 ? '-' : '+')\n + (absHours < 10 ? '0' : '') + (absHours)\n + (absMinutes < 10 ? ':0' : ':') + (absMinutes);\n const absSeconds = MathUtil.intMod(absTotalSeconds, LocalTime.SECONDS_PER_MINUTE);\n if (absSeconds !== 0) {\n buf += (absSeconds < 10 ? ':0' : ':') + (absSeconds);\n }\n return buf;\n }\n }\n\n\n /**\n *\n * @param {number} totalSeconds\n * @private\n */\n static _validateTotalSeconds(totalSeconds){\n if (Math.abs(totalSeconds) > ZoneOffset.MAX_SECONDS) {\n throw new DateTimeException('Zone offset not in valid range: -18:00 to +18:00');\n }\n }\n\n /**\n *\n * @param {number} hours\n * @param {number} minutes\n * @param {number} seconds\n * @private\n */\n static _validate(hours, minutes, seconds) {\n if (hours < -18 || hours > 18) {\n throw new DateTimeException('Zone offset hours not in valid range: value ' + hours +\n ' is not in the range -18 to 18');\n }\n if (hours > 0) {\n if (minutes < 0 || seconds < 0) {\n throw new DateTimeException('Zone offset minutes and seconds must be positive because hours is positive');\n }\n } else if (hours < 0) {\n if (minutes > 0 || seconds > 0) {\n throw new DateTimeException('Zone offset minutes and seconds must be negative because hours is negative');\n }\n } else if ((minutes > 0 && seconds < 0) || (minutes < 0 && seconds > 0)) {\n throw new DateTimeException('Zone offset minutes and seconds must have the same sign');\n }\n if (Math.abs(minutes) > 59) {\n throw new DateTimeException('Zone offset minutes not in valid range: abs(value) ' +\n Math.abs(minutes) + ' is not in the range 0 to 59');\n }\n if (Math.abs(seconds) > 59) {\n throw new DateTimeException('Zone offset seconds not in valid range: abs(value) ' +\n Math.abs(seconds) + ' is not in the range 0 to 59');\n }\n if (Math.abs(hours) === 18 && (Math.abs(minutes) > 0 || Math.abs(seconds) > 0)) {\n throw new DateTimeException('Zone offset not in valid range: -18:00 to +18:00');\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZoneOffset} using the ID.\n *\n * This method parses the string ID of a {@link ZoneOffset} to\n * return an instance. The parsing accepts all the formats generated by\n * {@link getId}, plus some additional formats:\n *\n * * {@link Z} - for UTC\n * * `+h`\n * * `+hh`\n * * `+hh:mm`\n * * `-hh:mm`\n * * `+hhmm`\n * * `-hhmm`\n * * `+hh:mm:ss`\n * * `-hh:mm:ss`\n * * `+hhmmss`\n * * `-hhmmss`\n *\n * Note that ± means either the plus or minus symbol.\n *\n * The ID of the returned offset will be normalized to one of the formats\n * described by {@link getId}.\n *\n * The maximum supported range is from +18:00 to -18:00 inclusive.\n *\n * @param {string} offsetId the offset ID, not null\n * @return {ZoneOffset} the zone-offset, not null\n * @throws DateTimeException if the offset ID is invalid\n */\n static of(offsetId) {\n requireNonNull(offsetId, 'offsetId');\n // \"Z\" is always in the cache\n const offset = ID_CACHE[offsetId];\n if (offset != null) {\n return offset;\n }\n\n // parse - +h, +hh, +hhmm, +hh:mm, +hhmmss, +hh:mm:ss\n let hours, minutes, seconds;\n switch (offsetId.length) {\n case 2:\n offsetId = offsetId[0] + '0' + offsetId[1]; // fallthru\n // eslint-disable-next-line no-fallthrough\n case 3:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = 0;\n seconds = 0;\n break;\n case 5:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 3, false);\n seconds = 0;\n break;\n case 6:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 4, true);\n seconds = 0;\n break;\n case 7:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 3, false);\n seconds = ZoneOffset._parseNumber(offsetId, 5, false);\n break;\n case 9:\n hours = ZoneOffset._parseNumber(offsetId, 1, false);\n minutes = ZoneOffset._parseNumber(offsetId, 4, true);\n seconds = ZoneOffset._parseNumber(offsetId, 7, true);\n break;\n default:\n throw new DateTimeException('Invalid ID for ZoneOffset, invalid format: ' + offsetId);\n }\n const first = offsetId[0];\n if (first !== '+' && first !== '-') {\n throw new DateTimeException('Invalid ID for ZoneOffset, plus/minus not found when expected: ' + offsetId);\n }\n if (first === '-') {\n return ZoneOffset.ofHoursMinutesSeconds(-hours, -minutes, -seconds);\n } else {\n return ZoneOffset.ofHoursMinutesSeconds(hours, minutes, seconds);\n }\n }\n\n /**\n * Parse a two digit zero-prefixed number.\n *\n * @param {string} offsetId - the offset ID, not null\n * @param {number} pos - the position to parse, valid\n * @param {boolean} precededByColon - should this number be prefixed by a precededByColon\n * @return {number} the parsed number, from 0 to 99\n */\n static _parseNumber(offsetId, pos, precededByColon) {\n if (precededByColon && offsetId[pos - 1] !== ':') {\n throw new DateTimeException('Invalid ID for ZoneOffset, colon not found when expected: ' + offsetId);\n }\n const ch1 = offsetId[pos];\n const ch2 = offsetId[pos + 1];\n if (ch1 < '0' || ch1 > '9' || ch2 < '0' || ch2 > '9') {\n throw new DateTimeException('Invalid ID for ZoneOffset, non numeric characters found: ' + offsetId);\n }\n return (ch1.charCodeAt(0) - 48) * 10 + (ch2.charCodeAt(0) - 48);\n }\n\n /**\n *\n * @param {number} hours\n * @returns {ZoneOffset}\n */\n static ofHours(hours) {\n return ZoneOffset.ofHoursMinutesSeconds(hours, 0, 0);\n }\n\n /**\n *\n * @param {number} hours\n * @param {number} minutes\n * @returns {ZoneOffset}\n */\n static ofHoursMinutes(hours, minutes) {\n return ZoneOffset.ofHoursMinutesSeconds(hours, minutes, 0);\n }\n\n /**\n *\n * @param {number} hours\n * @param {number} minutes\n * @param {number} seconds\n * @returns {ZoneOffset}\n */\n static ofHoursMinutesSeconds(hours, minutes, seconds) {\n ZoneOffset._validate(hours, minutes, seconds);\n const totalSeconds = hours * LocalTime.SECONDS_PER_HOUR + minutes * LocalTime.SECONDS_PER_MINUTE + seconds;\n return ZoneOffset.ofTotalSeconds(totalSeconds);\n }\n\n /**\n *\n * @param {number} totalMinutes\n * @returns {ZoneOffset}\n */\n static ofTotalMinutes(totalMinutes) {\n const totalSeconds = totalMinutes * LocalTime.SECONDS_PER_MINUTE;\n return ZoneOffset.ofTotalSeconds(totalSeconds);\n }\n\n /**\n *\n * @param {number} totalSeconds\n * @returns {ZoneOffset}\n */\n static ofTotalSeconds(totalSeconds) {\n if (totalSeconds % (15 * LocalTime.SECONDS_PER_MINUTE) === 0) {\n const totalSecs = totalSeconds;\n let result = SECONDS_CACHE[totalSecs];\n if (result == null) {\n result = new ZoneOffset(totalSeconds);\n SECONDS_CACHE[totalSecs] = result;\n ID_CACHE[result.id()] = result;\n }\n return result;\n } else {\n return new ZoneOffset(totalSeconds);\n }\n }\n\n /**\n * Gets the associated time-zone rules.\n *\n * The rules will always return this offset when queried.\n * The implementation class is immutable, thread-safe and serializable.\n *\n * @return {ZoneRules} the rules, not null\n */\n rules() {\n return this._rules;\n }\n\n /**\n * Gets the value of the specified field from this offset as an `int`.\n *\n * This queries this offset 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 OFFSET_SECONDS} field returns the value of the offset.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this offset as a `long`.\n *\n * This queries this offset 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 OFFSET_SECONDS} field returns the value of the offset.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field === ChronoField.OFFSET_SECONDS) {\n return this._totalSeconds;\n } else if (field instanceof ChronoField) {\n throw new DateTimeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this offset using the specified query.\n *\n * This queries this offset 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 if (query === TemporalQueries.offset() || query === TemporalQueries.zone()) {\n return this;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.precision() || query === TemporalQueries.chronology() || query === TemporalQueries.zoneId()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have the same offset as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the offset changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#OFFSET_SECONDS} as the field.\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 = thisOffset.adjustInto(temporal);\n * temporal = temporal.with(thisOffset);\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(ChronoField.OFFSET_SECONDS, this._totalSeconds);\n }\n\n /**\n * Compares this offset to another offset in descending order.\n *\n * The offsets are compared in the order that they occur for the same time\n * of day around the world. Thus, an offset of `+10:00` comes before an\n * offset of `+09:00` and so on down to `-18:00`.\n *\n * The comparison is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {!ZoneOffset} other - the other date to compare to, not null\n * @return {number} the comparator value, negative if less, postive if greater\n * @throws NullPointerException if {@link other} is null\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n return other._totalSeconds - this._totalSeconds;\n }\n\n\n /**\n * Checks if this offset is equal to another offset.\n *\n * The comparison is based on the amount of the offset in seconds.\n * This is equivalent to a comparison by ID.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other offset\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof ZoneOffset) {\n return this._totalSeconds === obj._totalSeconds;\n }\n return false;\n }\n\n /**\n * @return {number}\n */\n hashCode(){\n return this._totalSeconds;\n }\n\n /**\n *\n * @returns {string}\n */\n toString(){\n return this._id;\n }\n}\n\nexport function _init() {\n ZoneOffset.MAX_SECONDS = 18 * LocalTime.SECONDS_PER_HOUR;\n ZoneOffset.UTC = ZoneOffset.ofTotalSeconds(0);\n ZoneOffset.MIN = ZoneOffset.ofTotalSeconds(-ZoneOffset.MAX_SECONDS);\n ZoneOffset.MAX = ZoneOffset.ofTotalSeconds(ZoneOffset.MAX_SECONDS);\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 {MathUtil} from './MathUtil';\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException, ArithmeticException, DateTimeParseException} from './errors';\n\nimport {IsoChronology} from './chrono/IsoChronology';\n\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalAmount} from './temporal/TemporalAmount';\n\nimport {LocalDate} from './LocalDate';\n\n/**\n * The pattern for parsing.\n */\nconst PATTERN = /([-+]?)P(?:([-+]?[0-9]+)Y)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)W)?(?:([-+]?[0-9]+)D)?/;\n\n/**\n * A date-based amount of time, such as '2 years, 3 months and 4 days'.\n *\n * This class models a quantity or amount of time in terms of years, months and days.\n * See {@link Duration} for the time-based equivalent to this class.\n *\n * Durations and period differ in their treatment of daylight savings time\n * when added to {@link ZonedDateTime}. A {@link Duration} will add an exact\n * number of seconds, thus a duration of one day is always exactly 24 hours.\n * By contrast, a {@link Period} will add a conceptual day, trying to maintain\n * the local time.\n *\n * For example, consider adding a period of one day and a duration of one day to\n * 18:00 on the evening before a daylight savings gap. The {@link Period} will add\n * the conceptual day and result in a {@link ZonedDateTime} at 18:00 the following day.\n * By contrast, the {@link Duration} will add exactly 24 hours, resulting in a\n * {@link ZonedDateTime} at 19:00 the following day (assuming a one hour DST gap).\n *\n * The supported units of a period are {@link ChronoUnit#YEARS},\n * {@link ChronoUnit#MONTHS} and {@link ChronoUnit#DAYS}.\n * All three fields are always present, but may be set to zero.\n *\n * The period may be used with any calendar system.\n * The meaning of a 'year' or 'month' is only applied when the object is added to a date.\n *\n * The period is modeled as a directed amount of time, meaning that individual parts of the\n * period may be negative.\n *\n * The months and years fields may be normalized (see {@link normalized}).\n * The normalization assumes a 12 month year, so is not appropriate for all calendar systems.\n *\n * ### Static properties of Class {@link Period}\n *\n * Period.ZERO\n *\n * A constant for a period of zero.\n *\n */\nexport class Period extends TemporalAmount /* extends ChronoPeriod */ {\n\n /**\n * do not call the constructor directly\n * use a factory method instead\n *\n * @param {number} years\n * @param {number} months\n * @param {number} days\n * @private\n */\n constructor(years, months, days){\n super();\n \n const _years = MathUtil.safeToInt(years);\n const _months = MathUtil.safeToInt(months);\n const _days = MathUtil.safeToInt(days);\n\n if((_years | _months | _days) === 0){\n if (!Period.ZERO) {\n this._years = _years;\n this._months = _months;\n this._days = _days;\n Period.ZERO = this;\n }\n return Period.ZERO;\n }\n \n /**\n * The number of years.\n */\n this._years = _years;\n /**\n * The number of months.\n */\n this._months = _months;\n /**\n * The number of days.\n */\n this._days = _days;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a {@link Period} representing a number of years.\n *\n * The resulting period will have the specified years.\n * The months and days units will be zero.\n *\n * @param {number} years - the number of years, positive or negative\n * @return {Period} the period of years, not null\n */\n static ofYears(years) {\n return Period.create(years, 0, 0);\n }\n\n /**\n * Obtains a {@link Period} representing a number of months.\n *\n * The resulting period will have the specified months.\n * The years and days units will be zero.\n *\n * @param {number} months - the number of months, positive or negative\n * @return {Period} the period of months, not null\n */\n static ofMonths(months) {\n return Period.create(0, months, 0);\n }\n\n /**\n * Obtains a {@link Period} representing a number of weeks.\n *\n * The resulting period will have days equal to the weeks multiplied by seven.\n * The years and months units will be zero.\n *\n * @param {number} weeks - the number of weeks, positive or negative\n * @return {Period} the period of days, not null\n */\n static ofWeeks(weeks) {\n return Period.create(0, 0, MathUtil.safeMultiply(weeks, 7));\n }\n\n /**\n * Obtains a {@link Period} representing a number of days.\n *\n * The resulting period will have the specified days.\n * The years and months units will be zero.\n *\n * @param {number} days - the number of days, positive or negative\n * @return {Period} the period of days, not null\n */\n static ofDays(days) {\n return Period.create(0, 0, days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains a {@link Period} representing a number of years, months and days.\n *\n * This creates an instance based on years, months and days.\n *\n * @param {!number} years - the amount of years, may be negative\n * @param {!number} months - the amount of months, may be negative\n * @param {!number} days - the amount of days, may be negative\n * @return {Period} the period of years, months and days, not null\n */\n static of(years, months, days) {\n return Period.create(years, months, days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Period} from a temporal amount.\n *\n * This obtains a period based on the specified amount.\n * A {@link TemporalAmount} represents an - amount of time, which may be\n * date-based or time-based, which this factory extracts to a {@link Period}.\n *\n * The conversion loops around the set of units from the amount and uses\n * the {@link ChronoUnit#YEARS}, {@link ChronoUnit#MONTHS}\n * and {@link ChronoUnit#DAYS} units to create a period.\n * If any other units are found then an exception is thrown.\n *\n * If the amount is a {@link ChronoPeriod} then it must use the ISO chronology.\n *\n * @param {TemporalAmount} amount - the temporal amount to convert, not null\n * @return {Period} the equivalent period, not null\n * @throws DateTimeException if unable to convert to a {@link Period}\n * @throws ArithmeticException if the amount of years, months or days exceeds an int\n */\n static from(amount) {\n if (amount instanceof Period) {\n return amount;\n }\n /*\n if (amount instanceof ChronoPeriod) {\n if (IsoChronology.INSTANCE !== amount.chronology()) {\n throw new DateTimeException('Period requires ISO chronology: ' + amount);\n }\n }\n*/\n requireNonNull(amount, 'amount');\n let years = 0;\n let months = 0;\n let days = 0;\n const units = amount.units();\n for (let i=0; i
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = thisPeriod.addTo(dateTime);\n * dateTime = dateTime.plus(thisPeriod);\n *\n *\n * The calculation will add the years, then months, then days.\n * Only non-zero amounts will be added.\n * If the date-time has a calendar system with a fixed number of months in a\n * year, then the years and months will be combined before being added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to add\n * @throws ArithmeticException if numeric overflow occurs\n */\n addTo(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._years !== 0) {\n if (this._months !== 0) {\n temporal = temporal.plus(this.toTotalMonths(), ChronoUnit.MONTHS);\n } else {\n temporal = temporal.plus(this._years, ChronoUnit.YEARS);\n }\n } else if (this._months !== 0) {\n temporal = temporal.plus(this._months, ChronoUnit.MONTHS);\n }\n if (this._days !== 0) {\n temporal = temporal.plus(this._days, ChronoUnit.DAYS);\n }\n return temporal;\n }\n\n /**\n * Subtracts this period from the specified temporal object.\n *\n * This returns a temporal object of the same observable type as the input\n * with this period subtracted.\n *\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#minus}.\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = thisPeriod.subtractFrom(dateTime);\n * dateTime = dateTime.minus(thisPeriod);\n *\n *\n * The calculation operates as follows.\n * First, the chronology of the temporal is checked to ensure it is ISO chronology or null.\n * Second, if the months are zero, the years are added if non-zero, otherwise\n * the combination of years and months is added if non-zero.\n * Finally, any days are added.\n *\n * The calculation will subtract the years, then months, then days.\n * Only non-zero amounts will be subtracted.\n * If the date-time has a calendar system with a fixed number of months in a\n * year, then the years and months will be combined before being subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} temporal - the temporal object to adjust, not null\n * @return {Temporal} an object of the same type with the adjustment made, not null\n * @throws DateTimeException if unable to subtract\n * @throws ArithmeticException if numeric overflow occurs\n */\n subtractFrom(temporal) {\n requireNonNull(temporal, 'temporal');\n if (this._years !== 0) {\n if (this._months !== 0) {\n temporal = temporal.minus(this.toTotalMonths(), ChronoUnit.MONTHS);\n } else {\n temporal = temporal.minus(this._years, ChronoUnit.YEARS);\n }\n } else if (this._months !== 0) {\n temporal = temporal.minus(this._months, ChronoUnit.MONTHS);\n }\n if (this._days !== 0) {\n temporal = temporal.minus(this._days, ChronoUnit.DAYS);\n }\n return temporal;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this period is equal to another period.\n *\n * The comparison is based on the amounts held in the period.\n * To be equal, the years, months and days units must be individually equal.\n * Note that this means that a period of '15 Months' is not equal to a period\n * of '1 Year and 3 Months'.\n *\n * @param {*} obj - the object to check, null returns false\n * @return {boolean} true if this is equal to the other period\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Period) {\n const other = obj;\n return this._years === other._years &&\n this._months === other._months &&\n this._days === other._days;\n }\n return false;\n }\n\n /**\n * A hash code for this period.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._years, this._months, this._days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this period as a string, such as {@link P6Y3M1D}.\n *\n * The output will be in the ISO-8601 period format.\n * A zero period will be represented as zero days, 'P0D'.\n *\n * @return {string} a string representation of this period, not null\n */\n toString() {\n if (this === Period.ZERO) {\n return 'P0D';\n } else {\n let buf = 'P';\n if (this._years !== 0) {\n buf += '' + this._years + 'Y';\n }\n if (this._months !== 0) {\n buf += '' + this._months + 'M';\n }\n if (this._days !== 0) {\n buf += '' + this._days + 'D';\n }\n return buf;\n }\n }\n\n /**\n *\n * @return {string} same as {@link Period.toString}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nexport function _init() {\n /**\n * A constant for a period of zero.\n */\n Period.ofDays(0);\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\n/**\n * @private\n */\nexport class ParsePosition {\n constructor(index) {\n this._index = index;\n this._errorIndex = -1;\n }\n\n getIndex(){\n return this._index;\n }\n\n setIndex(index){\n this._index = index;\n }\n\n getErrorIndex(){\n return this._errorIndex;\n }\n\n setErrorIndex(errorIndex){\n this._errorIndex = errorIndex;\n }\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\n/**\n * @private\n */\nexport class EnumMap {\n constructor(){\n this._map = {};\n }\n\n putAll(otherMap){\n for(const key in otherMap._map){\n this._map[key] = otherMap._map[key];\n }\n return this;\n }\n\n containsKey(key){\n return (this._map.hasOwnProperty(key.name())) && (this.get(key) !== undefined);\n }\n\n get(key) {\n return this._map[key.name()];\n }\n\n put(key, val) {\n return this.set(key, val);\n }\n\n set(key, val) {\n this._map[key.name()] = val;\n return this;\n }\n\n retainAll(keyList){\n const map = {};\n for(let i=0; i
\n * This locale is used to control localization in the print output except\n * where localization is controlled by the symbols.\n *\n * @return the locale, not null\n */\n locale() {\n return this._locale;\n }\n\n //-------------------------------------------------------------------------\n // for testing\n /**\n * Sets the date-time being output.\n *\n * @param temporal the date-time object, not null\n */\n setDateTime(temporal) {\n this._temporal = temporal;\n }\n\n setLocale(locale) {\n this._locale = locale;\n }\n\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 {Enum} from '../Enum';\n\nexport class SignStyle extends Enum{\n /**\n * Parse helper.\n *\n * @param positive true if positive sign parsed, false for negative sign\n * @param strict true if strict, false if lenient\n * @param fixedWidth true if fixed width, false if not\n * @return true if valid\n */\n parse(positive, strict, fixedWidth){\n switch (this) {\n case SignStyle.NORMAL: // NORMAL\n // valid if negative or (positive and lenient)\n return !positive || !strict;\n case SignStyle.ALWAYS: // ALWAYS\n case SignStyle.EXCEEDS_PAD: // EXCEEDS_PAD\n return true;\n default:\n // valid if lenient and not fixed width\n return !strict && !fixedWidth;\n }\n\n }\n}\n\nSignStyle.NORMAL = new SignStyle('NORMAL');\nSignStyle.NEVER = new SignStyle('NEVER');\nSignStyle.ALWAYS = new SignStyle('ALWAYS');\nSignStyle.EXCEEDS_PAD = new SignStyle('EXCEEDS_PAD');\nSignStyle.NOT_NEGATIVE = new SignStyle('NOT_NEGATIVE');\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\n/**\n * @private\n */\nexport class StringBuilder {\n constructor(){\n this._str = '';\n }\n\n append(str){\n this._str += str;\n return this;\n }\n\n appendChar(str){\n this._str += str[0];\n return this;\n }\n\n insert(offset, str){\n this._str = this._str.slice(0, offset) + str + this._str.slice(offset);\n return this;\n }\n\n replace(start, end, str){\n this._str = this._str.slice(0, start) + str + this._str.slice(end);\n return this;\n }\n\n length(){\n return this._str.length;\n }\n\n setLength(length){\n this._str = this._str.slice(0, length);\n return this;\n }\n\n\n toString() {\n return this._str;\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 {assert, requireNonNull} from '../assert';\n\nimport {DateTimeParseException, NullPointerException} from '../errors';\n\nimport {Period} from '../Period';\n\nimport {ParsePosition} from './ParsePosition';\nimport {DateTimeBuilder} from './DateTimeBuilder';\nimport {DateTimeParseContext} from './DateTimeParseContext';\nimport {DateTimePrintContext} from './DateTimePrintContext';\nimport {DateTimeFormatterBuilder} from './DateTimeFormatterBuilder';\nimport {SignStyle} from './SignStyle';\nimport {StringBuilder} from './StringBuilder';\nimport {ResolverStyle} from './ResolverStyle';\n\nimport {IsoChronology} from '../chrono/IsoChronology';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {createTemporalQuery} from '../temporal/TemporalQuery';\n\n/**\n *\n * ### Static properties of Class {@link DateTimeFormatter}\n *\n * DateTimeFormatter.ISO_LOCAL_DATE\n *\n * DateTimeFormatter.ISO_LOCAL_TIME\n *\n * DateTimeFormatter.ISO_LOCAL_DATE_TIME\n *\n */\nexport class DateTimeFormatter {\n\n //-----------------------------------------------------------------------\n /**\n * A query that provides access to the excess days that were parsed.\n *\n * This returns a singleton {@link TemporalQuery} that provides\n * access to additional information from the parse. The query always returns\n * a non-null period, with a zero period returned instead of null.\n *\n * There are two situations where this query may return a non-zero period.\n *\n * * If the {@link ResolverStyle} is {@link LENIENT} and a time is parsed\n * without a date, then the complete result of the parse consists of a\n * {@link LocalTime} and an excess {@link Period} in days.\n * * If the {@link ResolverStyle} is {@link SMART} and a time is parsed\n * without a date where the time is 24:00:00, then the complete result of\n * the parse consists of a {@link LocalTime} of 00:00:00 and an excess\n * {@link Period} of one day.\n *\n * In both cases, if a complete {@link ChronoLocalDateTime} or {@link Instant}\n * is parsed, then the excess days are added to the date part.\n * As a result, this query will return a zero period.\n *\n * The {@link SMART} behaviour handles the common \"end of day\" 24:00 value.\n * Processing in {@link LENIENT} mode also produces the same result:\n *
\n * Text to parse Parsed object Excess days\n * \"2012-12-03T00:00\" LocalDateTime.of(2012, 12, 3, 0, 0) ZERO\n * \"2012-12-03T24:00\" LocalDateTime.of(2012, 12, 4, 0, 0) ZERO\n * \"00:00\" LocalTime.of(0, 0) ZERO\n * \"24:00\" LocalTime.of(0, 0) Period.ofDays(1)\n *\n * The query can be used as follows:\n *
\n * TemporalAccessor parsed = formatter.parse(str);\n * LocalTime time = parsed.query(LocalTime.FROM);\n * Period extraDays = parsed.query(DateTimeFormatter.parsedExcessDays());\n *\n * @return {TemporalQuery} a query that provides access to the excess days that were parsed\n */\n static parsedExcessDays() {\n return DateTimeFormatter.PARSED_EXCESS_DAYS;\n }\n\n /**\n * A query that provides access to whether a leap-second was parsed.\n *\n * This returns a singleton {@link TemporalQuery} that provides\n * access to additional information from the parse. The query always returns\n * a non-null boolean, true if parsing saw a leap-second, false if not.\n *\n * Instant parsing handles the special \"leap second\" time of '23:59:60'.\n * Leap seconds occur at '23:59:60' in the UTC time-zone, but at other\n * local times in different time-zones. To avoid this potential ambiguity,\n * the handling of leap-seconds is limited to\n * {@link DateTimeFormatterBuilder#appendInstant}, as that method\n * always parses the instant with the UTC zone offset.\n *\n * If the time '23:59:60' is received, then a simple conversion is applied,\n * replacing the second-of-minute of 60 with 59. This query can be used\n * on the parse result to determine if the leap-second adjustment was made.\n * The query will return one second of excess if it did adjust to remove\n * the leap-second, and zero if not. Note that applying a leap-second\n * smoothing mechanism, such as UTC-SLS, is the responsibility of the\n * application, as follows:\n *
\n * TemporalAccessor parsed = formatter.parse(str);\n * Instant instant = parsed.query(Instant::from);\n * if (parsed.query(DateTimeFormatter.parsedLeapSecond())) {\n * // validate leap-second is correct and apply correct smoothing\n * }\n *\n * @return a query that provides access to whether a leap-second was parsed\n */\n static parsedLeapSecond() {\n return DateTimeFormatter.PARSED_LEAP_SECOND;\n }\n\n /**\n * Creates a formatter using the specified pattern.\n *\n * This method will create a formatter based on a simple pattern of letters and symbols.\n *\n * The returned formatter will use the default locale, but this can be changed\n * using {@link DateTimeFormatter.withLocale}.\n *\n * All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters.\n * The following pattern letters are defined:\n *
\n * |Symbol |Meaning |Presentation |Examples\n * |--------|----------------------------|------------------|----------------------------------------------------\n * | G | era | number/text | 1; 01; AD; Anno Domini\n * | u | year | year | 2004; 04\n * | y | year-of-era | year | 2004; 04\n * | D | day-of-year | number | 189\n * | M | month-of-year | number/text | 7; 07; Jul; July; J\n * | d | day-of-month | number | 10\n * | | | |\n * | Q | quarter-of-year | number/text | 3; 03; Q3\n * | Y | week-based-year | year | 1996; 96\n * | w | week-of-year | number | 27\n * | W | week-of-month | number | 27\n * | e | localized day-of-week | number | 2; Tue; Tuesday; T\n * | E | day-of-week | number/text | 2; Tue; Tuesday; T\n * | F | week-of-month | number | 3\n * | | | |\n * | a | am-pm-of-day | text | PM\n * | h | clock-hour-of-am-pm (1-12) | number | 12\n * | K | hour-of-am-pm (0-11) | number | 0\n * | k | clock-hour-of-am-pm (1-24) | number | 0\n * | | | |\n * | H | hour-of-day (0-23) | number | 0\n * | m | minute-of-hour | number | 30\n * | s | second-of-minute | number | 55\n * | S | fraction-of-second | fraction | 978\n * | A | milli-of-day | number | 1234\n * | n | nano-of-second | number | 987654321\n * | N | nano-of-day | number | 1234000000\n * | | | |\n * | V | time-zone ID | zone-id | America/Los_Angeles; Z; -08:30\n * | z | time-zone name | zone-name | Pacific Standard Time; PST\n * | X | zone-offset 'Z' for zero | offset-X | Z; -08; -0830; -08:30; -083015; -08:30:15;\n * | x | zone-offset | offset-x | +0000; -08; -0830; -08:30; -083015; -08:30:15;\n * | Z | zone-offset | offset-Z | +0000; -0800; -08:00;\n * | | | |\n * | p | pad next | pad modifier | 1\n * | | | |\n * | ' | escape for text | delimiter |\n * | '' | single quote | literal | '\n * | [ | optional section start | |\n * | ] | optional section end | |\n * | {} | reserved for future use | |\n *\n *\n * The count of pattern letters determine the format.\n *\n * **Text**: The text style is determined based on the number of pattern letters used.\n * Less than 4 pattern letters will use the short form `TextStyle.SHORT`.\n * Exactly 4 pattern letters will use the full form `TextStyle.FULL`.\n * Exactly 5 pattern letters will use the narrow form `TextStyle.NARROW`.\n *\n * **NOTE**: since text styles require locale support, they are currently not supported in js-joda!\n *\n * **Number**: If the count of letters is one, then the value is printed using the minimum number\n * of digits and without padding as per {@link DateTimeFormatterBuilder.appendValue}.\n * Otherwise, the count of digits is used as the width of the output field as per\n * {@link DateTimeFormatterBuilder.appendValue}.\n *\n * **Number/Text**: If the count of pattern letters is 3 or greater, use the Text rules above.\n * Otherwise use the Number rules above.\n *\n * **Fraction**: Outputs the nano-of-second field as a fraction-of-second.\n * The nano-of-second value has nine digits, thus the count of pattern letters is from 1 to 9.\n * If it is less than 9, then the nano-of-second value is truncated, with only the most\n * significant digits being output.\n * When parsing in strict mode, the number of parsed digits must match the count of pattern letters.\n * When parsing in lenient mode, the number of parsed digits must be at least the count of pattern\n * letters, up to 9 digits.\n *\n * **Year**: The count of letters determines the minimum field width below which padding is used.\n * If the count of letters is two, then a {@link DateTimeFormatterBuilder.appendValueReduced}\n * two digit form is used.\n * For printing, this outputs the rightmost two digits. For parsing, this will parse using the\n * base value of 2000, resulting in a year within the range 2000 to 2099 inclusive.\n * If the count of letters is less than four (but not two), then the sign is only output for negative\n * years as per `SignStyle.NORMAL`.\n * Otherwise, the sign is output if the pad width is exceeded, as per `SignStyle.EXCEEDS_PAD`\n *\n * **ZoneId**: This outputs the time-zone ID, such as 'Europe/Paris'.\n * If the count of letters is two, then the time-zone ID is output.\n * Any other count of letters throws `IllegalArgumentException`.\n *\n * **Zone names**: This outputs the display name of the time-zone ID.\n * If the count of letters is one, two or three, then the short name is output.\n * If the count of letters is four, then the full name is output.\n * Five or more letters throws `IllegalArgumentException`.\n *\n * **NOTE**: since zone ids and name require the iana tzdb, they are currently not supported in js-joda!\n *\n * **Offset X and x**: This formats the offset based on the number of pattern letters.\n * One letter outputs just the hour', such as '+01', unless the minute is non-zero\n * in which case the minute is also output, such as '+0130'.\n * Two letters outputs the hour and minute, without a colon, such as '+0130'.\n * Three letters outputs the hour and minute, with a colon, such as '+01:30'.\n * Four letters outputs the hour and minute and optional second, without a colon, such as '+013015'.\n * Five letters outputs the hour and minute and optional second, with a colon, such as '+01:30:15'.\n * Six or more letters throws `IllegalArgumentException`.\n * Pattern letter 'X' (upper case) will output 'Z' when the offset to be output would be zero,\n * whereas pattern letter 'x' (lower case) will output '+00', '+0000', or '+00:00'.\n *\n * **Offset Z**: This formats the offset based on the number of pattern letters.\n * One, two or three letters outputs the hour and minute, without a colon, such as '+0130'.\n * Four or more letters throws `IllegalArgumentException`.\n * The output will be '+0000' when the offset is zero.\n *\n * **Optional section**: The optional section markers work exactly like calling\n * {@link DateTimeFormatterBuilder.optionalStart} and {@link DateTimeFormatterBuilder.optionalEnd}.\n *\n * **Pad modifier**: Modifies the pattern that immediately follows to be padded with spaces.\n * The pad width is determined by the number of pattern letters.\n * This is the same as calling {@link DateTimeFormatterBuilder.padNext}.\n *\n * For example, 'ppH' outputs the hour-of-day padded on the left with spaces to a width of 2.\n *\n * Any unrecognized letter is an error.\n * Any non-letter character, other than '[', ']', '{', '}' and the single quote will be output directly.\n * Despite this, it is recommended to use single quotes around all characters that you want to\n * output directly to ensure that future changes do not break your application.\n *\n * @param {String} pattern the pattern to use, not null\n * @return {DateTimeFormatter} the formatter based on the pattern, not null\n * @throws IllegalArgumentException if the pattern is invalid\n * @see DateTimeFormatterBuilder#appendPattern(String)\n * @example\n * var s = LocalDate.parse('2016-04-01').format(DateTimeFormatter.ofPattern('d MM yyyy'));\n * console.log(s); // '1 04 2016'\n *\n */\n static ofPattern(pattern) {\n return new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter();\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param printerParser the printer/parser to use, not null\n * @param locale the locale to use, not null\n * @param decimalStyle the decimal style to use, not null\n * @param resolverStyle the resolver style to use, not null\n * @param resolverFields the fields to use during resolving, null for all fields\n * @param chrono the chronology to use, null for no override\n * @param zone the zone to use, null for no override\n * @private\n */\n constructor(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono=IsoChronology.INSTANCE, zone) {\n assert(printerParser != null);\n assert(decimalStyle != null);\n assert(resolverStyle != null);\n /**\n * The printer and/or parser to use, not null.\n */\n this._printerParser = printerParser;\n /**\n * The locale to use for formatting. // nyi\n */\n this._locale = locale;\n /**\n * The symbols to use for formatting, not null.\n */\n this._decimalStyle = decimalStyle;\n /**\n * The resolver style to use, not null.\n */\n this._resolverStyle = resolverStyle;\n /**\n * The fields to use in resolving, null for all fields.\n */\n this._resolverFields = resolverFields;\n /**\n * The chronology to use for formatting, null for no override.\n */\n this._chrono = chrono;\n /**\n * The zone to use for formatting, null for no override. // nyi\n */\n this._zone = zone;\n }\n\n locale() {\n return this._locale;\n }\n\n decimalStyle() {\n return this._decimalStyle;\n }\n\n chronology() {\n return this._chrono;\n }\n\n /**\n * Returns a copy of this formatter with a new override chronology.\n *\n * This returns a formatter with similar state to this formatter but\n * with the override chronology set.\n * By default, a formatter has no override chronology, returning null.\n *\n * If an override is added, then any date that is printed or parsed will be affected.\n *\n * When printing, if the {@link Temporal} object contains a date then it will\n * be converted to a date in the override chronology.\n * Any time or zone will be retained unless overridden.\n * The converted result will behave in a manner equivalent to an implementation\n * of {@link ChronoLocalDate},{@link ChronoLocalDateTime} or {@link ChronoZonedDateTime}.\n *\n * When parsing, the override chronology will be used to interpret the\n * {@link ChronoField} into a date unless the\n * formatter directly parses a valid chronology.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param chrono the new chronology, not null\n * @return a formatter based on this formatter with the requested override chronology, not null\n */\n withChronology(chrono) {\n if (this._chrono != null && this._chrono.equals(chrono)) {\n return this;\n }\n return new DateTimeFormatter(this._printerParser, this._locale, this._decimalStyle,\n this._resolverStyle, this._resolverFields, chrono, this._zone);\n }\n\n /**\n * not yet supported\n * @returns {DateTimeFormatter}\n */\n withLocale(){\n return this;\n }\n\n /**\n * Returns a copy of this formatter with a new resolver style.\n *
\n * This returns a formatter with similar state to this formatter but\n * with the resolver style set. By default, a formatter has the\n * {@link ResolverStyle#SMART SMART} resolver style.\n *
\n * Changing the resolver style only has an effect during parsing.\n * Parsing a text string occurs in two phases.\n * Phase 1 is a basic text parse according to the fields added to the builder.\n * Phase 2 resolves the parsed field-value pairs into date and/or time objects.\n * The resolver style is used to control how phase 2, resolving, happens.\n * See {@link ResolverStyle} for more information on the options available.\n *
\n * This instance is immutable and unaffected by this method call.\n *\n * @param {ResolverStyle} resolverStyle the new resolver style, not null\n * @return {DateTimeFormatter} a formatter based on this formatter with the requested resolver style, not null\n */\n withResolverStyle(resolverStyle) {\n requireNonNull(resolverStyle, 'resolverStyle');\n if (resolverStyle.equals(this._resolverStyle)) {\n return this;\n }\n return new DateTimeFormatter(this._printerParser, this._locale, this._decimalStyle, resolverStyle, this._resolverFields, this._chrono, this._zone);\n }\n //-----------------------------------------------------------------------\n /**\n * Formats a date-time object using this formatter.\n *\n * This formats the date-time to a String using the rules of the formatter.\n *\n * @param {TemporalAccessor} temporal the temporal object to print, not null\n * @return {String} the printed string, not null\n * @throws DateTimeException if an error occurs during formatting\n */\n format(temporal) {\n const buf = new StringBuilder(32);\n this._formatTo(temporal, buf);\n return buf.toString();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Formats a date-time object to an {@link Appendable} using this formatter.\n *\n * This formats the date-time to the specified destination.\n * {@link Appendable} is a general purpose interface that is implemented by all\n * key character output classes including {@link StringBuffer}, {@link StringBuilder},\n * {@link PrintStream} and {@link Writer}.\n *\n * Although {@link Appendable} methods throw an {@link IOException}, this method does not.\n * Instead, any {@link IOException} is wrapped in a runtime exception.\n *\n * @param {TemporalAccessor} temporal - the temporal object to print, not null\n * @param {StringBuilder} appendable - the appendable to print to, not null\n * @throws DateTimeException if an error occurs during formatting\n */\n _formatTo(temporal, appendable) {\n requireNonNull(temporal, 'temporal');\n requireNonNull(appendable, 'appendable');\n const context = new DateTimePrintContext(temporal, this);\n this._printerParser.print(context, appendable);\n }\n\n /**\n * function overloading for {@link DateTimeFormatter.parse}\n *\n * if called with one arg {@link DateTimeFormatter.parse1} is called\n * otherwise {@link DateTimeFormatter.parse2}\n *\n * @param {string} text\n * @param {TemporalQuery} type\n * @return {TemporalAccessor}\n */\n parse(text, type){\n if(arguments.length === 1){\n return this.parse1(text);\n } else {\n return this.parse2(text, type);\n }\n }\n\n /**\n * Fully parses the text producing a temporal object.\n *\n * This parses the entire text producing a temporal object.\n * It is typically more useful to use {@link parse}.\n * The result of this method is {@link TemporalAccessor} which has been resolved,\n * applying basic validation checks to help ensure a valid date-time.\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 * @return {TemporalAccessor} the parsed temporal object, not null\n * @throws DateTimeParseException if unable to parse the requested result\n */\n parse1(text) {\n requireNonNull(text, 'text');\n try {\n return this._parseToBuilder(text, null).resolve(this._resolverStyle, this._resolverFields);\n } catch (ex) {\n if(ex instanceof DateTimeParseException){\n throw ex;\n } else {\n throw this._createError(text, ex);\n }\n }\n }\n\n /**\n * Fully parses the text producing a temporal object.\n *\n * This parses the entire text producing a temporal object.\n * It is typically more useful to use {@link parse}.\n * The result of this method is {@link TemporalAccessor} which has been resolved,\n * applying basic validation checks to help ensure a valid date-time.\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 text the text to parse, not null\n * @param type the type to extract, not null\n * @return the parsed temporal object, not null\n * @throws DateTimeParseException if unable to parse the requested result\n */\n parse2(text, type) {\n requireNonNull(text, 'text');\n requireNonNull(type, 'type');\n try {\n const builder = this._parseToBuilder(text, null).resolve(this._resolverStyle, this._resolverFields);\n return builder.build(type);\n } catch (ex) {\n if(ex instanceof DateTimeParseException){\n throw ex;\n } else {\n throw this._createError(text, ex);\n }\n }\n }\n\n _createError(text, ex) {\n let abbr = '';\n if (text.length > 64) {\n abbr = text.substring(0, 64) + '...';\n } else {\n abbr = text;\n }\n return new DateTimeParseException('Text \\'' + abbr + '\\' could not be parsed: ' + ex.message, text, 0, ex);\n }\n\n\n /**\n * Parses the text to a builder.\n *\n * This parses to a {@link DateTimeBuilder} ensuring that the text is fully parsed.\n * This method throws {@link DateTimeParseException} if unable to parse, or\n * some other {@link DateTimeException} if another date/time problem occurs.\n *\n * @param text the text to parse, not null\n * @param position the position to parse from, updated with length parsed\n * and the index of any error, null if parsing whole string\n * @return the engine representing the result of the parse, not null\n * @throws DateTimeParseException if the parse fails\n */\n _parseToBuilder(text, position) {\n const pos = (position != null ? position : new ParsePosition(0));\n const result = this._parseUnresolved0(text, pos);\n if (result == null || pos.getErrorIndex() >= 0 || (position == null && pos.getIndex() < text.length)) {\n let abbr = '';\n if (text.length > 64) {\n abbr = text.substr(0, 64).toString() + '...';\n } else {\n abbr = text;\n }\n if (pos.getErrorIndex() >= 0) {\n throw new DateTimeParseException('Text \\'' + abbr + '\\' could not be parsed at index ' +\n pos.getErrorIndex(), text, pos.getErrorIndex());\n } else {\n throw new DateTimeParseException('Text \\'' + abbr + '\\' could not be parsed, unparsed text found at index ' +\n pos.getIndex(), text, pos.getIndex());\n }\n }\n return result.toBuilder();\n }\n\n /**\n * Parses the text using this formatter, without resolving the result, intended\n * for advanced use cases.\n *\n * Parsing is implemented as a two-phase operation.\n * First, the text is parsed using the layout defined by the formatter, producing\n * a {@link Map} of field to value, a {@link ZoneId} and a {@link Chronology}.\n * Second, the parsed data is *resolved*, by validating, combining and\n * simplifying the various fields into more useful ones.\n * This method performs the parsing stage but not the resolving stage.\n *\n * The result of this method is {@link TemporalAccessor} which represents the\n * data as seen in the input. Values are not validated, thus parsing a date string\n * of '2012-00-65' would result in a temporal with three fields - year of '2012',\n * month of '0' and day-of-month of '65'.\n *\n * The text will be parsed from the specified start {@link ParsePosition}.\n * The entire length of the text does not have to be parsed, the {@link ParsePosition}\n * will be updated with the index at the end of parsing.\n *\n * Errors are returned using the error index field of the {@link ParsePosition}\n * instead of {@link DateTimeParseException}.\n * The returned error index will be set to an index indicative of the error.\n * Callers must check for errors before using the context.\n *\n * If the formatter parses the same field more than once with different values,\n * the result will be an error.\n *\n * This method is intended for advanced use cases that need access to the\n * internal state during parsing. Typical application code should use\n * {@link parse} or the parse method on the target type.\n *\n * @param text the text to parse, not null\n * @param position the position to parse from, updated with length parsed\n * and the index of any error, not null\n * @return the parsed text, null if the parse results in an error\n * @throws DateTimeException if some problem occurs during parsing\n * @throws IndexOutOfBoundsException if the position is invalid\n */\n parseUnresolved(text, position) {\n return this._parseUnresolved0(text, position);\n }\n\n _parseUnresolved0(text, position) {\n assert(text != null, 'text', NullPointerException);\n assert(position != null, 'position', NullPointerException);\n const context = new DateTimeParseContext(this);\n let pos = position.getIndex();\n pos = this._printerParser.parse(context, text, pos);\n if (pos < 0) {\n position.setErrorIndex(~pos); // index not updated from input\n return null;\n }\n position.setIndex(pos); // errorIndex not updated from input\n return context.toParsed();\n }\n\n /**\n * Returns the formatter as a composite printer parser.\n *\n * @param {boolean} optional whether the printer/parser should be optional\n * @return {CompositePrinterParser} the printer/parser, not null\n */\n _toPrinterParser(optional) {\n return this._printerParser.withOptional(optional);\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n const pattern = this._printerParser.toString();\n return pattern.indexOf('[') === 0 ? pattern : pattern.substring(1, pattern.length - 1);\n }\n\n}\n\nexport function _init() {\n\n DateTimeFormatter.ISO_LOCAL_DATE = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .appendLiteral('-')\n .appendValue(ChronoField.DAY_OF_MONTH, 2)\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_LOCAL_TIME = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.HOUR_OF_DAY, 2)\n .appendLiteral(':')\n .appendValue(ChronoField.MINUTE_OF_HOUR, 2)\n .optionalStart()\n .appendLiteral(':')\n .appendValue(ChronoField.SECOND_OF_MINUTE, 2)\n .optionalStart()\n .appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, true)\n .toFormatter(ResolverStyle.STRICT);\n\n DateTimeFormatter.ISO_LOCAL_DATE_TIME = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .append(DateTimeFormatter.ISO_LOCAL_DATE)\n .appendLiteral('T')\n .append(DateTimeFormatter.ISO_LOCAL_TIME)\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_INSTANT = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .appendInstant()\n .toFormatter(ResolverStyle.STRICT);\n\n DateTimeFormatter.ISO_OFFSET_DATE_TIME = new DateTimeFormatterBuilder()\n .parseCaseInsensitive()\n .append(DateTimeFormatter.ISO_LOCAL_DATE_TIME)\n .appendOffsetId()\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.ISO_ZONED_DATE_TIME = new DateTimeFormatterBuilder()\n .append(DateTimeFormatter.ISO_OFFSET_DATE_TIME)\n .optionalStart()\n .appendLiteral('[')\n .parseCaseSensitive()\n .appendZoneId()\n // .appendZoneRegionId()\n .appendLiteral(']')\n .toFormatter(ResolverStyle.STRICT).withChronology(IsoChronology.INSTANCE);\n\n DateTimeFormatter.PARSED_EXCESS_DAYS = createTemporalQuery('PARSED_EXCESS_DAYS', (temporal) => {\n if (temporal instanceof DateTimeBuilder) {\n return temporal.excessDays;\n } else {\n return Period.ZERO;\n }\n });\n\n DateTimeFormatter.PARSED_LEAP_SECOND = createTemporalQuery('PARSED_LEAP_SECOND', (temporal) => {\n if (temporal instanceof DateTimeBuilder) {\n return temporal.leapSecond;\n } else {\n return false;\n }\n });\n\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 {requireNonNull, requireInstance} from '../assert';\n\nimport {ChronoField} from '../temporal/ChronoField';\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {DateTimeFormatter} from '../format/DateTimeFormatter';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\nimport {Temporal} from '../temporal/Temporal';\n\nimport {LocalDate} from '../LocalDate';\n\n/**\n * A date without time-of-day or time-zone in an arbitrary chronology, intended\n * for advanced globalization use cases.\n *\n * **Most applications should declare method signatures, fields and variables\n * as {@link LocalDate}, not this interface.**\n *\n * A {@link ChronoLocalDate} is the abstract representation of a date where the\n * {@link Chronology}, or calendar system, is pluggable.\n * The date is defined in terms of fields expressed by {@link TemporalField},\n * where most common implementations are defined in {@link ChronoField}.\n * The chronology defines how the calendar system operates and the meaning of\n * the standard fields.\n *\n * #### When to use this interface\n *\n * The design of the API encourages the use of {@link LocalDate} rather than this\n * interface, even in the case where the application needs to deal with multiple\n * calendar systems. The rationale for this is explored in the following documentation.\n *\n * The primary use case where this interface should be used is where the generic\n * type parameter `C` is fully defined as a specific chronology.\n * In that case, the assumptions of that chronology are known at development\n * time and specified in the code.\n *\n * When the chronology is defined in the generic type parameter as ? or otherwise\n * unknown at development time, the rest of the discussion below applies.\n *\n * To emphasize the point, declaring a method signature, field or variable as this\n * interface type can initially seem like the sensible way to globalize an application,\n * however it is usually the wrong approach.\n * As such, it should be considered an application-wide architectural decision to choose\n * to use this interface as opposed to {@link LocalDate}.\n *\n * #### Architectural issues to consider\n *\n * These are some of the points that must be considered before using this interface\n * throughout an application.\n *\n * 1) Applications using this interface, as opposed to using just {@link LocalDate},\n * face a significantly higher probability of bugs. This is because the calendar system\n * in use is not known at development time. A key cause of bugs is where the developer\n * applies assumptions from their day-to-day knowledge of the ISO calendar system\n * to code that is intended to deal with any arbitrary calendar system.\n * The section below outlines how those assumptions can cause problems\n * The primary mechanism for reducing this increased risk of bugs is a strong code review process.\n * This should also be considered a extra cost in maintenance for the lifetime of the code.\n *\n * 2) This interface does not enforce immutability of implementations.\n * While the implementation notes indicate that all implementations must be immutable\n * there is nothing in the code or type system to enforce this. Any method declared\n * to accept a {@link ChronoLocalDate} could therefore be passed a poorly or\n * maliciously written mutable implementation.\n *\n * 3) Applications using this interface must consider the impact of eras.\n * {@link LocalDate} shields users from the concept of eras, by ensuring that `getYear()`\n * returns the proleptic year. That decision ensures that developers can think of\n * {@link LocalDate} instances as consisting of three fields - year, month-of-year and day-of-month.\n * By contrast, users of this interface must think of dates as consisting of four fields -\n * era, year-of-era, month-of-year and day-of-month. The extra era field is frequently\n * forgotten, yet it is of vital importance to dates in an arbitrary calendar system.\n * For example, in the Japanese calendar system, the era represents the reign of an Emperor.\n * Whenever one reign ends and another starts, the year-of-era is reset to one.\n *\n * 4) The only agreed international standard for passing a date between two systems\n * is the ISO-8601 standard which requires the ISO calendar system. Using this interface\n * throughout the application will inevitably lead to the requirement to pass the date\n * across a network or component boundary, requiring an application specific protocol or format.\n *\n * 5) Long term persistence, such as a database, will almost always only accept dates in the\n * ISO-8601 calendar system (or the related Julian-Gregorian). Passing around dates in other\n * calendar systems increases the complications of interacting with persistence.\n *\n * 6) Most of the time, passing a {@link ChronoLocalDate} throughout an application\n * is unnecessary, as discussed in the last section below.\n *\n * #### False assumptions causing bugs in multi-calendar system code\n *\n * As indicated above, there are many issues to consider when try to use and manipulate a\n * date in an arbitrary calendar system. These are some of the key issues.\n *\n * Code that queries the day-of-month and assumes that the value will never be more than\n * 31 is invalid. Some calendar systems have more than 31 days in some months.\n *\n * Code that adds 12 months to a date and assumes that a year has been added is invalid.\n * Some calendar systems have a different number of months, such as 13 in the Coptic or Ethiopic.\n *\n * Code that adds one month to a date and assumes that the month-of-year value will increase\n * by one or wrap to the next year is invalid. Some calendar systems have a variable number\n * of months in a year, such as the Hebrew.\n *\n * Code that adds one month, then adds a second one month and assumes that the day-of-month\n * will remain close to its original value is invalid. Some calendar systems have a large difference\n * between the length of the longest month and the length of the shortest month.\n * For example, the Coptic or Ethiopic have 12 months of 30 days and 1 month of 5 days.\n *\n * Code that adds seven days and assumes that a week has been added is invalid.\n * Some calendar systems have weeks of other than seven days, such as the French Revolutionary.\n *\n * Code that assumes that because the year of `date1` is greater than the year of `date2`\n * then `date1` is after `date2` is invalid. This is invalid for all calendar systems\n * when referring to the year-of-era, and especially untrue of the Japanese calendar system\n * where the year-of-era restarts with the reign of every new Emperor.\n *\n * Code that treats month-of-year one and day-of-month one as the start of the year is invalid.\n * Not all calendar systems start the year when the month value is one.\n *\n * In general, manipulating a date, and even querying a date, is wide open to bugs when the\n * calendar system is unknown at development time. This is why it is essential that code using\n * this interface is subjected to additional code reviews. It is also why an architectural\n * decision to avoid this interface type is usually the correct one.\n *\n * #### Using LocalDate instead\n *\n * The primary alternative to using this interface throughout your application is as follows.\n *\n * * Declare all method signatures referring to dates in terms of {@link LocalDate}.\n * * Either store the chronology (calendar system) in the user profile or lookup the chronology\n * from the user locale.\n * * Convert the ISO {@link LocalDate} to and from the user's preferred calendar system during\n * printing and parsing.\n *\n * This approach treats the problem of globalized calendar systems as a localization issue\n * and confines it to the UI layer. This approach is in keeping with other localization\n * issues in the java platform.\n *\n * As discussed above, performing calculations on a date where the rules of the calendar system\n * are pluggable requires skill and is not recommended.\n * Fortunately, the need to perform calculations on a date in an arbitrary calendar system\n * is extremely rare. For example, it is highly unlikely that the business rules of a library\n * book rental scheme will allow rentals to be for one month, where meaning of the month\n * is dependent on the user's preferred calendar system.\n *\n * A key use case for calculations on a date in an arbitrary calendar system is producing\n * a month-by-month calendar for display and user interaction. Again, this is a UI issue,\n * and use of this interface solely within a few methods of the UI layer may be justified.\n *\n * In any other part of the system, where a date must be manipulated in a calendar system\n * other than ISO, the use case will generally specify the calendar system to use.\n * For example, an application may need to calculate the next Islamic or Hebrew holiday\n * which may require manipulating the date.\n * This kind of use case can be handled as follows:\n *\n * * start from the ISO {@link LocalDate} being passed to the method\n * * convert the date to the alternate calendar system, which for this use case is known\n * rather than arbitrary\n * * perform the calculation\n * * convert back to {@link LocalDate}\n *\n * Developers writing low-level frameworks or libraries should also avoid this interface.\n * Instead, one of the two general purpose access interfaces should be used.\n * Use {@link TemporalAccessor} if read-only access is required, or use {@link Temporal}\n * if read-write access is required.\n *\n * ### Specification for implementors\n *\n * This interface must be implemented with care to ensure other classes operate correctly.\n * All implementations that can be instantiated must be final, immutable and thread-safe.\n * Subclasses should be Serializable wherever possible.\n *\n * Additional calendar systems may be added to the system.\n * See {@link Chronology} for more details.\n *\n * In JDK 8, this is an interface with default methods.\n * Since there are no default methods in JDK 7, an abstract class is used.\n */\nexport class ChronoLocalDate extends Temporal {\n\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isDateBased();\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isDateBased();\n }\n return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);\n }\n\n query(query) {\n if (query === TemporalQueries.chronology()) {\n return this.chronology();\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.DAYS;\n } else if (query === TemporalQueries.localDate()) {\n return LocalDate.ofEpochDay(this.toEpochDay());\n } else if (query === TemporalQueries.localTime() || query === TemporalQueries.zone() ||\n query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n\n adjustInto(temporal) {\n return temporal.with(ChronoField.EPOCH_DAY, this.toEpochDay());\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 * The default implementation must behave as follows:\n *
\n * return formatter.format(this);\n *\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 requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.format(this);\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 {UnsupportedTemporalTypeException, IllegalStateException} from '../errors';\n\nimport {DayOfWeek} from '../DayOfWeek';\nimport {Duration} from '../Duration';\nimport {MathUtil} from '../MathUtil';\nimport {LocalDate} from '../LocalDate';\n\nimport {ChronoField} from './ChronoField';\nimport {ChronoUnit} from './ChronoUnit';\nimport {TemporalField} from './TemporalField';\nimport {TemporalUnit} from './TemporalUnit';\nimport {ValueRange} from './ValueRange';\n\nimport {IsoChronology} from '../chrono/IsoChronology';\n\nimport {ResolverStyle} from '../format/ResolverStyle';\n\n/**\n * Fields and units specific to the ISO-8601 calendar system,\n * including quarter-of-year and week-based-year.\n *\n * This class defines fields and units that are specific to the ISO calendar system.\n *\n * ### Quarter of year\n *\n * The ISO-8601 standard is based on the standard civic 12 month year.\n * This is commonly divided into four quarters, often abbreviated as Q1, Q2, Q3 and Q4.\n *\n * January, February and March are in Q1.\n * April, May and June are in Q2.\n * July, August and September are in Q3.\n * October, November and December are in Q4.\n *\n * The complete date is expressed using three fields:\n *\n * * {@link DAY_OF_QUARTER} - the day within the quarter, from 1 to 90, 91 or 92\n * * {@link QUARTER_OF_YEAR} - the week within the week-based-year\n * * {@link ChronoField#YEAR} - the standard ISO year\n *\n * ### Week based years\n *\n * The ISO-8601 standard was originally intended as a data interchange format,\n * defining a string format for dates and times. However, it also defines an\n * alternate way of expressing the date, based on the concept of week-based-year.\n *\n * The date is expressed using three fields:\n *\n * * {@link ChronoField#DAY_OF_WEEK} - the standard field defining the\n * day-of-week from Monday (1) to Sunday (7)\n * * {@link WEEK_OF_WEEK_BASED_YEAR} - the week within the week-based-year\n * * {@link WEEK_BASED_YEAR} - the week-based-year\n *\n * The week-based-year itself is defined relative to the standard ISO proleptic year.\n * It differs from the standard year in that it always starts on a Monday.\n *\n * The first week of a week-based-year is the first Monday-based week of the standard\n * ISO year that has at least 4 days in the new year.\n *\n * * If January 1st is Monday then week 1 starts on January 1st\n * * If January 1st is Tuesday then week 1 starts on December 31st of the previous standard year\n * * If January 1st is Wednesday then week 1 starts on December 30th of the previous standard year\n * * If January 1st is Thursday then week 1 starts on December 29th of the previous standard year\n * * If January 1st is Friday then week 1 starts on January 4th\n * * If January 1st is Saturday then week 1 starts on January 3rd\n * * If January 1st is Sunday then week 1 starts on January 2nd\n *\n * There are 52 weeks in most week-based years, however on occasion there are 53 weeks.\n *\n * For example:\n *\n * * Sunday, 2008-12-28: Week 52 of week-based-year 2008\n * * Monday, 2008-12-29: Week 1 of week-based-year 2009\n * * Wednesday, 2008-12-31: Week 1 of week-based-year 2009\n * * Thursday, 2009-01-01: Week 1 of week-based-year 2009\n * * Sunday, 2009-01-04: Week 1 of week-based-year 2009\n * * Monday, 2009-01-05: Week 2 of week-based-year 2009\n *\n * ### Static properties of Class {@link IsoFields}\n *\n * IsoFields.DAY_OF_QUARTER\n *\n * The field that represents the day-of-quarter.\n *\n * This field allows the day-of-quarter value to be queried and set.\n * The day-of-quarter has values from 1 to 90 in Q1 of a standard year, from 1 to 91\n * in Q1 of a leap year, from 1 to 91 in Q2 and from 1 to 92 in Q3 and Q4.\n *\n * The day-of-quarter can only be calculated if the day-of-year, month-of-year and year\n * are available.\n *\n * When setting this field, the value is allowed to be partially lenient, taking any\n * value from 1 to 92. If the quarter has less than 92 days, then day 92, and\n * potentially day 91, is in the following quarter.\n *\n * IsoFields.QUARTER_OF_YEAR\n *\n * The field that represents the quarter-of-year.\n *\n * This field allows the quarter-of-year value to be queried and set.\n * The quarter-of-year has values from 1 to 4.\n *\n * The day-of-quarter can only be calculated if the month-of-year is available.\n *\n * IsoFields.WEEK_OF_WEEK_BASED_YEAR\n *\n * The field that represents the week-of-week-based-year.\n *\n * This field allows the week of the week-based-year value to be queried and set.\n *\n * IsoFields.WEEK_BASED_YEAR\n *\n * The field that represents the week-based-year.\n *\n * This field allows the week-based-year value to be queried and set.\n *\n * IsoFields.WEEK_BASED_YEARS\n *\n * The unit that represents week-based-years for the purpose of addition and subtraction.\n *\n * This allows a number of week-based-years to be added to, or subtracted from, a date.\n * The unit is equal to either 52 or 53 weeks.\n * The estimated duration of a week-based-year is the same as that of a standard ISO\n * year at 365.2425 days.\n *\n * The rules for addition add the number of week-based-years to the existing value\n * for the week-based-year field. If the resulting week-based-year only has 52 weeks,\n * then the date will be in week 1 of the following week-based-year.\n *\n * IsoFields.QUARTER_YEARS\n *\n * Unit that represents the concept of a quarter-year.\n * For the ISO calendar system, it is equal to 3 months.\n * The estimated duration of a quarter-year is one quarter of 365.2425 days.\n */\nexport class IsoFields {\n}\n\n//-----------------------------------------------------------------------\n\nconst QUARTER_DAYS = [0, 90, 181, 273, 0, 91, 182, 274];\n\n/**\n * Implementation of the field.\n */\nclass Field extends TemporalField{\n\n /**\n *\n * @returns {boolean}\n */\n isDateBased() {\n return true;\n }\n\n /**\n *\n * @returns {boolean}\n */\n isTimeBased() {\n return false;\n }\n\n /**\n *\n * @returns {boolean}\n */\n _isIso() {\n return true;\n }\n\n /**\n *\n * @param {LocalDate} date\n * @returns {ValueRange}\n */\n static _getWeekRangeByLocalDate(date) {\n const wby = Field._getWeekBasedYear(date);\n return ValueRange.of(1, Field._getWeekRangeByYear(wby));\n }\n\n /**\n *\n * @param {number} wby\n * @returns {number}\n */\n static _getWeekRangeByYear(wby) {\n const date = LocalDate.of(wby, 1, 1);\n // 53 weeks if standard 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 * @param {LocalDate} date\n * @returns {number}\n */\n static _getWeek(date) {\n const dow0 = date.dayOfWeek().ordinal();\n const doy0 = date.dayOfYear() - 1;\n const doyThu0 = doy0 + (3 - dow0); // adjust to mid-week Thursday (which is 3 indexed from zero)\n const alignedWeek = MathUtil.intDiv(doyThu0, 7);\n const firstThuDoy0 = doyThu0 - (alignedWeek * 7);\n let firstMonDoy0 = firstThuDoy0 - 3;\n if (firstMonDoy0 < -3) {\n firstMonDoy0 += 7;\n }\n if (doy0 < firstMonDoy0) {\n return Field._getWeekRangeByLocalDate(date.withDayOfYear(180).minusYears(1)).maximum();\n }\n let week = MathUtil.intDiv((doy0 - firstMonDoy0), 7) + 1;\n if (week === 53) {\n if ((firstMonDoy0 === -3 || (firstMonDoy0 === -2 && date.isLeapYear())) === false) {\n week = 1;\n }\n }\n return week;\n }\n\n /**\n *\n * @param {LocalDate} date\n * @returns {number}\n */\n static _getWeekBasedYear(date) {\n let year = date.year();\n let doy = date.dayOfYear();\n if (doy <= 3) {\n const dow = date.dayOfWeek().ordinal();\n if (doy - dow < -2) {\n year--;\n }\n } else if (doy >= 363) {\n const dow = date.dayOfWeek().ordinal();\n doy = doy - 363 - (date.isLeapYear() ? 1 : 0);\n if (doy - dow >= 0) {\n year++;\n }\n }\n return year;\n }\n\n /**\n *\n * @returns {string}\n */\n getDisplayName(/*locale*/) {\n return this.toString();\n }\n\n /**\n *\n * @returns {null}\n */\n resolve() {\n return null;\n }\n\n name(){\n return this.toString();\n }\n\n}\n\n\nclass DAY_OF_QUARTER_FIELD extends Field {\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'DayOfQuarter';\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n baseUnit() {\n return ChronoUnit.DAYS;\n }\n\n /**\n *\n * @returns {TemporalUnit}\n */\n rangeUnit() {\n return QUARTER_YEARS;\n }\n\n /**\n *\n * @returns {ValueRange}\n */\n range() {\n return ValueRange.of(1, 90, 92);\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {boolean}\n */\n isSupportedBy(temporal) {\n return temporal.isSupported(ChronoField.DAY_OF_YEAR) && temporal.isSupported(ChronoField.MONTH_OF_YEAR) &&\n temporal.isSupported(ChronoField.YEAR) && this._isIso(temporal);\n }\n\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {ValueRange}\n */\n rangeRefinedBy(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: DayOfQuarter');\n }\n const qoy = temporal.getLong(QUARTER_OF_YEAR);\n if (qoy === 1) {\n const year = temporal.getLong(ChronoField.YEAR);\n return (IsoChronology.isLeapYear(year) ? ValueRange.of(1, 91) : ValueRange.of(1, 90));\n } else if (qoy === 2) {\n return ValueRange.of(1, 91);\n } else if (qoy === 3 || qoy === 4) {\n return ValueRange.of(1, 92);\n } // else value not from 1 to 4, so drop through\n return this.range();\n }\n\n /**\n *\n * @param {TemporalAccessor} temporal\n * @returns {number}\n */\n getFrom(temporal) {\n if (temporal.isSupported(this) === false) {\n throw new UnsupportedTemporalTypeException('Unsupported field: DayOfQuarter');\n }\n const doy = temporal.get(ChronoField.DAY_OF_YEAR);\n const moy = temporal.get(ChronoField.MONTH_OF_YEAR);\n const year = temporal.getLong(ChronoField.YEAR);\n return doy - QUARTER_DAYS[MathUtil.intDiv((moy - 1), 3) + (IsoChronology.isLeapYear(year) ? 4 : 0)];\n }\n\n /**\n *\n * @param {Temporal} temporal\n * @param {number} newValue\n * @returns {temporal}\n */\n adjustInto(temporal, newValue) {\n const curValue = this.getFrom(temporal);\n this.range().checkValidValue(newValue, this);\n return temporal.with(ChronoField.DAY_OF_YEAR, temporal.getLong(ChronoField.DAY_OF_YEAR) + (newValue - curValue));\n }\n\n /**\n *\n * @param {Map
\n * |Symbol |Meaning |Presentation |Examples\n * |--------|----------------------------|------------------|----------------------------------------------------\n * | G | era | number/text | 1; 01; AD; Anno Domini\n * | u | year | year | 2004; 04\n * | y | year-of-era | year | 2004; 04\n * | D | day-of-year | number | 189\n * | M | month-of-year | number/text | 7; 07; Jul; July; J\n * | d | day-of-month | number | 10\n * | | | |\n * | Q | quarter-of-year | number/text | 3; 03; Q3\n * | Y | week-based-year | year | 1996; 96\n * | w | week-of-year | number | 27\n * | W | week-of-month | number | 27\n * | e | localized day-of-week | number | 2; Tue; Tuesday; T\n * | E | day-of-week | number/text | 2; Tue; Tuesday; T\n * | F | week-of-month | number | 3\n * | | | |\n * | a | am-pm-of-day | text | PM\n * | h | clock-hour-of-am-pm (1-12) | number | 12\n * | K | hour-of-am-pm (0-11) | number | 0\n * | k | clock-hour-of-am-pm (1-24) | number | 0\n * | | | |\n * | H | hour-of-day (0-23) | number | 0\n * | m | minute-of-hour | number | 30\n * | s | second-of-minute | number | 55\n * | S | fraction-of-second | fraction | 978\n * | A | milli-of-day | number | 1234\n * | n | nano-of-second | number | 987654321\n * | N | nano-of-day | number | 1234000000\n * | | | |\n * | V | time-zone ID | zone-id | America/Los_Angeles; Z; -08:30\n * | z | time-zone name | zone-name | Pacific Standard Time; PST\n * | X | zone-offset 'Z' for zero | offset-X | Z; -08; -0830; -08:30; -083015; -08:30:15;\n * | x | zone-offset | offset-x | +0000; -08; -0830; -08:30; -083015; -08:30:15;\n * | Z | zone-offset | offset-Z | +0000; -0800; -08:00;\n * | | | |\n * | p | pad next | pad modifier | 1\n * | | | |\n * | ' | escape for text | delimiter |\n * | '' | single quote | literal | '\n * | [ | optional section start | |\n * | ] | optional section end | |\n * | {} | reserved for future use | |\n *\n *\n * The count of pattern letters determine the format.\n *\n * **Text**: The text style is determined based on the number of pattern letters used.\n * Less than 4 pattern letters will use the short form (see {@link TextStyle#SHORT}).\n * Exactly 4 pattern letters will use the full form (see {@link TextStyle#FULL}).\n * Exactly 5 pattern letters will use the narrow form (see {@link TextStyle#NARROW}).\n *\n * **Number**: If the count of letters is one, then the value is printed using the minimum number\n * of digits and without padding as per {@link appendValue}. Otherwise, the\n * count of digits is used as the width of the output field as per {@link appendValue}.\n *\n * **Number/Text**: If the count of pattern letters is 3 or greater, use the Text rules above.\n * Otherwise use the Number rules above.\n *\n * **Fraction**: Outputs the nano-of-second field as a fraction-of-second.\n * The nano-of-second value has nine digits, thus the count of pattern letters is from 1 to 9.\n * If it is less than 9, then the nano-of-second value is truncated, with only the most\n * significant digits being output.\n * When parsing in strict mode, the number of parsed digits must match the count of pattern letters.\n * When parsing in lenient mode, the number of parsed digits must be at least the count of pattern\n * letters, up to 9 digits.\n *\n * **Year**: The count of letters determines the minimum field width below which padding is used.\n * If the count of letters is two, then a reduced (see {@link appendValueReduced}) two digit form is used.\n * For printing, this outputs the rightmost two digits. For parsing, this will parse using the\n * base value of 2000, resulting in a year within the range 2000 to 2099 inclusive.\n * If the count of letters is less than four (but not two), then the sign is only output for negative\n * years as per {@link SignStyle#NORMAL}.\n * Otherwise, the sign is output if the pad width is exceeded, as per {@link SignStyle#EXCEEDS_PAD}\n *\n * **ZoneId**: This outputs the time-zone ID, such as 'Europe/Paris'.\n * If the count of letters is two, then the time-zone ID is output.\n * Any other count of letters throws {@link IllegalArgumentException}.\n *
\n * Pattern Equivalent builder methods\n * VV appendZoneId()\n *\n *\n * **Zone names**: This outputs the display name of the time-zone ID.\n * If the count of letters is one, two or three, then the short name is output.\n * If the count of letters is four, then the full name is output.\n * Five or more letters throws {@link IllegalArgumentException}.\n *
\n * Pattern Equivalent builder methods\n * z appendZoneText(TextStyle.SHORT)\n * zz appendZoneText(TextStyle.SHORT)\n * zzz appendZoneText(TextStyle.SHORT)\n * zzzz appendZoneText(TextStyle.FULL)\n *\n *\n * **Offset X and x**: This formats the offset based on the number of pattern letters.\n * One letter outputs just the hour', such as '+01', unless the minute is non-zero\n * in which case the minute is also output, such as '+0130'.\n * Two letters outputs the hour and minute, without a colon, such as '+0130'.\n * Three letters outputs the hour and minute, with a colon, such as '+01:30'.\n * Four letters outputs the hour and minute and optional second, without a colon, such as '+013015'.\n * Five letters outputs the hour and minute and optional second, with a colon, such as '+01:30:15'.\n * Six or more letters throws {@link IllegalArgumentException}.\n * Pattern letter 'X' (upper case) will output 'Z' when the offset to be output would be zero,\n * whereas pattern letter 'x' (lower case) will output '+00', '+0000', or '+00:00'.\n *
\n * Pattern Equivalent builder methods\n * X appendOffset(\"+HHmm\",\"Z\")\n * XX appendOffset(\"+HHMM\",\"Z\")\n * XXX appendOffset(\"+HH:MM\",\"Z\")\n * XXXX appendOffset(\"+HHMMss\",\"Z\")\n * XXXXX appendOffset(\"+HH:MM:ss\",\"Z\")\n * x appendOffset(\"+HHmm\",\"+00\")\n * xx appendOffset(\"+HHMM\",\"+0000\")\n * xxx appendOffset(\"+HH:MM\",\"+00:00\")\n * xxxx appendOffset(\"+HHMMss\",\"+0000\")\n * xxxxx appendOffset(\"+HH:MM:ss\",\"+00:00\")\n *\n *\n * **Offset Z**: This formats the offset based on the number of pattern letters.\n * One, two or three letters outputs the hour and minute, without a colon, such as '+0130'.\n * Four or more letters throws {@link IllegalArgumentException}.\n * The output will be '+0000' when the offset is zero.\n *
\n * Pattern Equivalent builder methods\n * Z appendOffset(\"+HHMM\",\"+0000\")\n * ZZ appendOffset(\"+HHMM\",\"+0000\")\n * ZZZ appendOffset(\"+HHMM\",\"+0000\")\n *\n *\n * **Optional section**: The optional section markers work exactly like calling {@link optionalStart}\n * and {@link optionalEnd}.\n *\n * **Pad modifier**: Modifies the pattern that immediately follows to be padded with spaces.\n * The pad width is determined by the number of pattern letters.\n * This is the same as calling {@link padNext}.\n *\n * For example, 'ppH' outputs the hour-of-day padded on the left with spaces to a width of 2.\n *\n * Any unrecognized letter is an error.\n * Any non-letter character, other than '[', ']', '{', '}' and the single quote will be output directly.\n * Despite this, it is recommended to use single quotes around all characters that you want to\n * output directly to ensure that future changes do not break your application.\n *\n * Note that the pattern string is similar, but not identical, to\n * {@link java.text.SimpleDateFormat}.\n * The pattern string is also similar, but not identical, to that defined by the\n * Unicode Common Locale Data Repository (CLDR/LDML).\n * Pattern letters 'E' and 'u' are merged, which changes the meaning of \"E\" and \"EE\" to be numeric.\n * Pattern letters 'X' is aligned with Unicode CLDR/LDML, which affects pattern 'X'.\n * Pattern letter 'y' and 'Y' parse years of two digits and more than 4 digits differently.\n * Pattern letters 'n', 'A', 'N', 'I' and 'p' are added.\n * Number types will reject large numbers.\n *\n * @param {String} pattern the pattern to add, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if the pattern is invalid\n */\n appendPattern(pattern) {\n requireNonNull(pattern, 'pattern');\n this._parsePattern(pattern);\n return this;\n }\n\n\n //-----------------------------------------------------------------------\n // empty implementations of locale functionality, be implemented/overridden by js-joda-locale\n\n appendZoneText() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n appendText() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n appendLocalizedOffset() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n appendWeekField() {\n throw new IllegalArgumentException('Pattern using (localized) text not implemented, use js-joda-locale plugin!');\n }\n\n //-----------------------------------------------------------------------\n\n _parsePattern(pattern) {\n /** Map of letters to fields. */\n const FIELD_MAP = {\n 'G': ChronoField.ERA,\n 'y': ChronoField.YEAR_OF_ERA,\n 'u': ChronoField.YEAR,\n 'Q': IsoFields.QUARTER_OF_YEAR,\n 'q': IsoFields.QUARTER_OF_YEAR,\n 'M': ChronoField.MONTH_OF_YEAR,\n 'L': ChronoField.MONTH_OF_YEAR,\n 'D': ChronoField.DAY_OF_YEAR,\n 'd': ChronoField.DAY_OF_MONTH,\n 'F': ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH,\n 'E': ChronoField.DAY_OF_WEEK,\n 'c': ChronoField.DAY_OF_WEEK,\n 'e': ChronoField.DAY_OF_WEEK,\n 'a': ChronoField.AMPM_OF_DAY,\n 'H': ChronoField.HOUR_OF_DAY,\n 'k': ChronoField.CLOCK_HOUR_OF_DAY,\n 'K': ChronoField.HOUR_OF_AMPM,\n 'h': ChronoField.CLOCK_HOUR_OF_AMPM,\n 'm': ChronoField.MINUTE_OF_HOUR,\n 's': ChronoField.SECOND_OF_MINUTE,\n 'S': ChronoField.NANO_OF_SECOND,\n 'A': ChronoField.MILLI_OF_DAY,\n 'n': ChronoField.NANO_OF_SECOND,\n 'N': ChronoField.NANO_OF_DAY\n };\n\n for (let pos = 0; pos < pattern.length; pos++) {\n let cur = pattern.charAt(pos);\n if ((cur >= 'A' && cur <= 'Z') || (cur >= 'a' && cur <= 'z')) {\n let start = pos++;\n for (; pos < pattern.length && pattern.charAt(pos) === cur; pos++); // short loop\n let count = pos - start;\n // padding\n if (cur === 'p') {\n let pad = 0;\n if (pos < pattern.length) {\n cur = pattern.charAt(pos);\n if ((cur >= 'A' && cur <= 'Z') || (cur >= 'a' && cur <= 'z')) {\n pad = count;\n start = pos++;\n for (; pos < pattern.length && pattern.charAt(pos) === cur; pos++); // short loop\n count = pos - start;\n }\n }\n if (pad === 0) {\n throw new IllegalArgumentException(\n 'Pad letter \\'p\\' must be followed by valid pad pattern: ' + pattern);\n }\n this.padNext(pad); // pad and continue parsing\n }\n // main rules\n const field = FIELD_MAP[cur];\n if (field != null) {\n this._parseField(cur, count, field);\n } else if (cur === 'z') {\n if (count > 4) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n } else if (count === 4) {\n this.appendZoneText(TextStyle.FULL);\n } else {\n this.appendZoneText(TextStyle.SHORT);\n }\n } else if (cur === 'V') {\n if (count !== 2) {\n throw new IllegalArgumentException('Pattern letter count must be 2: ' + cur);\n }\n this.appendZoneId();\n } else if (cur === 'Z') {\n if (count < 4) {\n this.appendOffset('+HHMM', '+0000');\n } else if (count === 4) {\n this.appendLocalizedOffset(TextStyle.FULL);\n } else if (count === 5) {\n this.appendOffset('+HH:MM:ss', 'Z');\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n } else if (cur === 'O') {\n if (count === 1) {\n this.appendLocalizedOffset(TextStyle.SHORT);\n } else if (count === 4) {\n this.appendLocalizedOffset(TextStyle.FULL);\n } else {\n throw new IllegalArgumentException('Pattern letter count must be 1 or 4: ' + cur);\n }\n } else if (cur === 'X') {\n if (count > 5) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n this.appendOffset(OffsetIdPrinterParser.PATTERNS[count + (count === 1 ? 0 : 1)], 'Z');\n } else if (cur === 'x') {\n if (count > 5) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n const zero = (count === 1 ? '+00' : (count % 2 === 0 ? '+0000' : '+00:00'));\n this.appendOffset(OffsetIdPrinterParser.PATTERNS[count + (count === 1 ? 0 : 1)], zero);\n } else if (cur === 'W') {\n if (count > 1) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n this.appendWeekField('W', count);\n } else if (cur === 'w') {\n if (count > 2) {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n this.appendWeekField('w', count);\n } else if (cur === 'Y') {\n this.appendWeekField('Y', count);\n } else {\n throw new IllegalArgumentException('Unknown pattern letter: ' + cur);\n }\n pos--;\n\n } else if (cur === '\\'') {\n // parse literals\n const start = pos++;\n for (; pos < pattern.length; pos++) {\n if (pattern.charAt(pos) === '\\'') {\n if (pos + 1 < pattern.length && pattern.charAt(pos + 1) === '\\'') {\n pos++;\n } else {\n break; // end of literal\n }\n }\n }\n if (pos >= pattern.length) {\n throw new IllegalArgumentException('Pattern ends with an incomplete string literal: ' + pattern);\n }\n const str = pattern.substring(start + 1, pos);\n if (str.length === 0) {\n this.appendLiteral('\\'');\n } else {\n this.appendLiteral(str.replace('\\'\\'', '\\''));\n }\n\n } else if (cur === '[') {\n this.optionalStart();\n\n } else if (cur === ']') {\n if (this._active._parent === null) {\n throw new IllegalArgumentException('Pattern invalid as it contains ] without previous [');\n }\n this.optionalEnd();\n\n } else if (cur === '{' || cur === '}' || cur === '#') {\n throw new IllegalArgumentException('Pattern includes reserved character: \\'' + cur + '\\'');\n } else {\n this.appendLiteral(cur);\n }\n }\n }\n\n _parseField(cur, count, field) {\n switch (cur) {\n case 'u':\n case 'y':\n if (count === 2) {\n this.appendValueReduced(field, 2, 2, ReducedPrinterParser.BASE_DATE);\n } else if (count < 4) {\n this.appendValue(field, count, MAX_WIDTH, SignStyle.NORMAL);\n } else {\n this.appendValue(field, count, MAX_WIDTH, SignStyle.EXCEEDS_PAD);\n }\n break;\n case 'M':\n case 'Q':\n switch (count) {\n case 1:\n this.appendValue(field);\n break;\n case 2:\n this.appendValue(field, 2);\n break;\n case 3:\n this.appendText(field, TextStyle.SHORT);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'L':\n case 'q':\n switch (count) {\n case 1:\n this.appendValue(field);\n break;\n case 2:\n this.appendValue(field, 2);\n break;\n case 3:\n this.appendText(field, TextStyle.SHORT_STANDALONE);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL_STANDALONE);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW_STANDALONE);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'e':\n switch (count) {\n case 1:\n case 2:\n this.appendWeekField('e', count);\n break;\n case 3:\n this.appendText(field, TextStyle.SHORT);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'c':\n switch (count) {\n case 1:\n this.appendWeekField('c', count);\n break;\n case 2:\n throw new IllegalArgumentException('Invalid number of pattern letters: ' + cur);\n case 3:\n this.appendText(field, TextStyle.SHORT_STANDALONE);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL_STANDALONE);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW_STANDALONE);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'a':\n if (count === 1) {\n this.appendText(field, TextStyle.SHORT);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'E':\n case 'G':\n switch (count) {\n case 1:\n case 2:\n case 3:\n this.appendText(field, TextStyle.SHORT);\n break;\n case 4:\n this.appendText(field, TextStyle.FULL);\n break;\n case 5:\n this.appendText(field, TextStyle.NARROW);\n break;\n default:\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n // eslint-disable-next-line no-unreachable\n break;\n case 'S':\n this.appendFraction(ChronoField.NANO_OF_SECOND, count, count, false);\n break;\n case 'F':\n if (count === 1) {\n this.appendValue(field);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'd':\n case 'h':\n case 'H':\n case 'k':\n case 'K':\n case 'm':\n case 's':\n if (count === 1) {\n this.appendValue(field);\n } else if (count === 2) {\n this.appendValue(field, count);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n case 'D':\n if (count === 1) {\n this.appendValue(field);\n } else if (count <= 3) {\n this.appendValue(field, count);\n } else {\n throw new IllegalArgumentException('Too many pattern letters: ' + cur);\n }\n break;\n default:\n if (count === 1) {\n this.appendValue(field);\n } else {\n this.appendValue(field, count);\n }\n break;\n }\n }\n\n /**\n * padNext function overloading\n */\n padNext() {\n if (arguments.length === 1) {\n return this._padNext1.apply(this, arguments);\n } else {\n return this._padNext2.apply(this, arguments);\n }\n }\n\n /**\n * Causes the next added printer/parser to pad to a fixed width using a space.\n *\n * This padding will pad to a fixed width using spaces.\n *\n * During formatting, the decorated element will be output and then padded\n * to the specified width. An exception will be thrown during printing if\n * the pad width is exceeded.\n *\n * During parsing, the padding and decorated element are parsed.\n * If parsing is lenient, then the pad width is treated as a maximum.\n * If parsing is case insensitive, then the pad character is matched ignoring case.\n * The padding is parsed greedily. Thus, if the decorated element starts with\n * the pad character, it will not be parsed.\n *\n * @param {number} padWidth the pad width, 1 or greater\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if pad width is too small\n */\n _padNext1(padWidth) {\n return this._padNext2(padWidth, ' ');\n }\n\n /**\n * Causes the next added printer/parser to pad to a fixed width.\n *\n * This padding is intended for padding other than zero-padding.\n * Zero-padding should be achieved using the appendValue methods.\n *\n * During formatting, the decorated element will be output and then padded\n * to the specified width. An exception will be thrown during printing if\n * the pad width is exceeded.\n *\n * During parsing, the padding and decorated element are parsed.\n * If parsing is lenient, then the pad width is treated as a maximum.\n * If parsing is case insensitive, then the pad character is matched ignoring case.\n * The padding is parsed greedily. Thus, if the decorated element starts with\n * the pad character, it will not be parsed.\n *\n * @param {number} padWidth the pad width, 1 or greater\n * @param {String} padChar the pad character\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalArgumentException if pad width is too small\n */\n _padNext2(padWidth, padChar) {\n if (padWidth < 1) {\n throw new IllegalArgumentException('The pad width must be at least one but was ' + padWidth);\n }\n this._active._padNextWidth = padWidth;\n this._active._padNextChar = padChar;\n this._active._valueParserIndex = -1;\n return this;\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Mark the start of an optional section.\n *\n * The output of printing can include optional sections, which may be nested.\n * An optional section is started by calling this method and ended by calling\n * {@link optionalEnd} or by ending the build process.\n *\n * All elements in the optional section are treated as optional.\n * During printing, the section is only output if data is available in the\n * {@link TemporalAccessor} for all the elements in the section.\n * During parsing, the whole section may be missing from the parsed string.\n *\n * For example, consider a builder setup as\n * `builder.appendValue(HOUR_OF_DAY,2).optionalStart().appendValue(MINUTE_OF_HOUR,2)`.\n * The optional section ends automatically at the end of the builder.\n * During printing, the minute will only be output if its value can be obtained from the date-time.\n * During parsing, the input will be successfully parsed whether the minute is present or not.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n optionalStart() {\n this._active._valueParserIndex = -1;\n this._active = DateTimeFormatterBuilder._of(this._active, true);\n return this;\n }\n\n /**\n * Ends an optional section.\n *\n * The output of printing can include optional sections, which may be nested.\n * An optional section is started by calling {@link optionalStart} and ended\n * using this method (or at the end of the builder).\n *\n * Calling this method without having previously called `optionalStart`\n * will throw an exception.\n * Calling this method immediately after calling `optionalStart` has no effect\n * on the formatter other than ending the (empty) optional section.\n *\n * All elements in the optional section are treated as optional.\n * During printing, the section is only output if data is available in the\n * {@link TemporalAccessor} for all the elements in the section.\n * During parsing, the whole section may be missing from the parsed string.\n *\n * For example, consider a builder setup as\n * `builder.appendValue(HOUR_OF_DAY,2).optionalStart().appendValue(MINUTE_OF_HOUR,2).optionalEnd()`.\n * During printing, the minute will only be output if its value can be obtained from the date-time.\n * During parsing, the input will be successfully parsed whether the minute is present or not.\n *\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n * @throws IllegalStateException if there was no previous call to `optionalStart`\n */\n optionalEnd() {\n if (this._active._parent == null) {\n throw new IllegalStateException('Cannot call optionalEnd() as there was no previous call to optionalStart()');\n }\n if (this._active._printerParsers.length > 0) {\n const cpp = new CompositePrinterParser(this._active._printerParsers, this._active._optional);\n this._active = this._active._parent;\n this._appendInternal(cpp);\n } else {\n this._active = this._active._parent;\n }\n return this;\n }\n\n /**\n * Appends a printer and/or parser to the internal list handling padding.\n *\n * @param pp the printer-parser to add, not null\n * @return the index into the active parsers list\n */\n _appendInternal(pp) {\n assert(pp != null);\n if (this._active._padNextWidth > 0) {\n if (pp != null) {\n pp = new PadPrinterParserDecorator(pp, this._active._padNextWidth, this._active._padNextChar);\n }\n this._active._padNextWidth = 0;\n this._active._padNextChar = 0;\n }\n this._active._printerParsers.push(pp);\n this._active._valueParserIndex = -1;\n return this._active._printerParsers.length - 1;\n }\n\n /**\n * Appends a string literal to the formatter.\n *\n * This string will be output during a print.\n *\n * If the literal is empty, nothing is added to the formatter.\n *\n * @param literal the literal to append, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n appendLiteral(literal) {\n assert(literal != null);\n if (literal.length > 0) {\n if (literal.length === 1) {\n this._appendInternalPrinterParser(new CharLiteralPrinterParser(literal.charAt(0)));\n } else {\n this._appendInternalPrinterParser(new StringLiteralPrinterParser(literal));\n }\n }\n return this;\n }\n\n /**\n * Appends a printer and/or parser to the internal list handling padding.\n *\n * @param pp the printer-parser to add, not null\n * @return the index into the active parsers list\n */\n _appendInternalPrinterParser(pp) {\n assert(pp != null);\n if (this._active._padNextWidth > 0) {\n if (pp != null) {\n pp = new PadPrinterParserDecorator(pp, this._active._padNextWidth, this._active._padNextChar);\n }\n this._active._padNextWidth = 0;\n this._active._padNextChar = 0;\n }\n this._active._printerParsers.push(pp);\n this._active._valueParserIndex = -1;\n return this._active._printerParsers.length - 1;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Appends all the elements of a formatter to the builder.\n *\n * This method has the same effect as appending each of the constituent\n * parts of the formatter directly to this builder.\n *\n * @param {DateTimeFormatter} formatter the formatter to add, not null\n * @return {DateTimeFormatterBuilder} this, for chaining, not null\n */\n append(formatter) {\n requireNonNull(formatter, 'formatter');\n this._appendInternal(formatter._toPrinterParser(false));\n return this;\n }\n\n /**\n * Completes this builder by creating the DateTimeFormatter.\n *\n * This will create a formatter with the specified locale.\n * Numbers will be printed and parsed using the standard non-localized set of symbols.\n *\n * Calling this method will end any open optional sections by repeatedly\n * calling {@link optionalEnd} before creating the formatter.\n *\n * This builder can still be used after creating the formatter if desired,\n * although the state may have been changed by calls to `optionalEnd`.\n *\n * @param resolverStyle the new resolver style\n * @return the created formatter, not null\n */\n toFormatter(resolverStyle=ResolverStyle.SMART) {\n while (this._active._parent != null) {\n this.optionalEnd();\n }\n const pp = new CompositePrinterParser(this._printerParsers, false);\n return new DateTimeFormatter(pp, null, DecimalStyle.STANDARD, resolverStyle, null, null, null);\n }\n\n}\n\n// days in a 400 year cycle = 146097\n// days in a 10,000 year cycle = 146097 * 25\n// seconds per day = 86400\nconst SECONDS_PER_10000_YEARS = 146097 * 25 * 86400;\nconst SECONDS_0000_TO_1970 = ((146097 * 5) - (30 * 365 + 7)) * 86400;\n\n/**\n * Prints or parses an ISO-8601 instant.\n */\nclass InstantPrinterParser {\n\n constructor(fractionalDigits) {\n this.fractionalDigits = fractionalDigits;\n }\n\n print(context, buf) {\n // use INSTANT_SECONDS, thus this code is not bound by Instant.MAX\n const inSecs = context.getValue(ChronoField.INSTANT_SECONDS);\n let inNanos = 0;\n if (context.temporal().isSupported(ChronoField.NANO_OF_SECOND)) {\n inNanos = context.temporal().getLong(ChronoField.NANO_OF_SECOND);\n }\n if (inSecs == null) {\n return false;\n }\n const inSec = inSecs;\n let inNano = ChronoField.NANO_OF_SECOND.checkValidIntValue(inNanos);\n if (inSec >= -SECONDS_0000_TO_1970) {\n // current era\n const zeroSecs = inSec - SECONDS_PER_10000_YEARS + SECONDS_0000_TO_1970;\n const hi = MathUtil.floorDiv(zeroSecs, SECONDS_PER_10000_YEARS) + 1;\n const lo = MathUtil.floorMod(zeroSecs, SECONDS_PER_10000_YEARS);\n const ldt = LocalDateTime.ofEpochSecond(lo - SECONDS_0000_TO_1970, 0, ZoneOffset.UTC);\n if (hi > 0) {\n buf.append('+').append(hi);\n }\n buf.append(ldt);\n if (ldt.second() === 0) {\n buf.append(':00');\n }\n } else {\n // before current era\n const zeroSecs = inSec + SECONDS_0000_TO_1970;\n const hi = MathUtil.intDiv(zeroSecs, SECONDS_PER_10000_YEARS);\n const lo = MathUtil.intMod(zeroSecs, SECONDS_PER_10000_YEARS);\n const ldt = LocalDateTime.ofEpochSecond(lo - SECONDS_0000_TO_1970, 0, ZoneOffset.UTC);\n const pos = buf.length();\n buf.append(ldt);\n if (ldt.second() === 0) {\n buf.append(':00');\n }\n if (hi < 0) {\n if (ldt.year() === -10000) {\n buf.replace(pos, pos + 2, '' + (hi - 1));\n } else if (lo === 0) {\n buf.insert(pos, hi);\n } else {\n buf.insert(pos + 1, Math.abs(hi));\n }\n }\n }\n //fraction\n if (this.fractionalDigits === -2) {\n if (inNano !== 0) {\n buf.append('.');\n if (MathUtil.intMod(inNano, 1000000) === 0) {\n buf.append(('' + (MathUtil.intDiv(inNano, 1000000) + 1000)).substring(1));\n } else if (MathUtil.intMod(inNano, 1000) === 0) {\n buf.append(('' + (MathUtil.intDiv(inNano, 1000) + 1000000)).substring(1));\n } else {\n buf.append(('' + ((inNano) + 1000000000)).substring(1));\n }\n }\n } else if (this.fractionalDigits > 0 || (this.fractionalDigits === -1 && inNano > 0)) {\n buf.append('.');\n let div = 100000000;\n for (let i = 0; ((this.fractionalDigits === -1 && inNano > 0) || i < this.fractionalDigits); i++) {\n const digit = MathUtil.intDiv(inNano, div);\n buf.append(digit);\n inNano = inNano - (digit * div);\n div = MathUtil.intDiv(div, 10);\n }\n }\n buf.append('Z');\n return true;\n }\n\n parse(context, text, position) {\n // new context to avoid overwriting fields like year/month/day\n const newContext = context.copy();\n const minDigits = (this.fractionalDigits < 0 ? 0 : this.fractionalDigits);\n const maxDigits = (this.fractionalDigits < 0 ? 9 : this.fractionalDigits);\n const parser = new DateTimeFormatterBuilder()\n .append(DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral('T')\n .appendValue(ChronoField.HOUR_OF_DAY, 2).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).appendLiteral(':')\n .appendValue(ChronoField.SECOND_OF_MINUTE, 2).appendFraction(ChronoField.NANO_OF_SECOND, minDigits, maxDigits, true).appendLiteral('Z')\n .toFormatter()._toPrinterParser(false);\n const pos = parser.parse(newContext, text, position);\n if (pos < 0) {\n return pos;\n }\n // parser restricts most fields to 2 digits, so definitely int\n // correctly parsed nano is also guaranteed to be valid\n const yearParsed = newContext.getParsed(ChronoField.YEAR);\n const month = newContext.getParsed(ChronoField.MONTH_OF_YEAR);\n const day = newContext.getParsed(ChronoField.DAY_OF_MONTH);\n let hour = newContext.getParsed(ChronoField.HOUR_OF_DAY);\n const min = newContext.getParsed(ChronoField.MINUTE_OF_HOUR);\n const secVal = newContext.getParsed(ChronoField.SECOND_OF_MINUTE);\n const nanoVal = newContext.getParsed(ChronoField.NANO_OF_SECOND);\n let sec = (secVal != null ? secVal : 0);\n const nano = (nanoVal != null ? nanoVal : 0);\n const year = MathUtil.intMod(yearParsed, 10000);\n let days = 0;\n if (hour === 24 && min === 0 && sec === 0 && nano === 0) {\n hour = 0;\n days = 1;\n } else if (hour === 23 && min === 59 && sec === 60) {\n context.setParsedLeapSecond();\n sec = 59;\n }\n let instantSecs;\n try {\n const ldt = LocalDateTime.of(year, month, day, hour, min, sec, 0).plusDays(days);\n instantSecs = ldt.toEpochSecond(ZoneOffset.UTC);\n instantSecs += MathUtil.safeMultiply(MathUtil.intDiv(yearParsed, 10000), SECONDS_PER_10000_YEARS);\n } catch (ex) {\n return ~position;\n }\n let successPos = pos;\n successPos = context.setParsedField(ChronoField.INSTANT_SECONDS, instantSecs, position, successPos);\n return context.setParsedField(ChronoField.NANO_OF_SECOND, nano, position, successPos);\n }\n\n toString() {\n return 'Instant()';\n }\n}\n\n\nexport function _init() {\n ReducedPrinterParser.BASE_DATE = LocalDate.of(2000, 1, 1);\n\n DateTimeFormatterBuilder.CompositePrinterParser = CompositePrinterParser;\n DateTimeFormatterBuilder.PadPrinterParserDecorator = PadPrinterParserDecorator;\n DateTimeFormatterBuilder.SettingsParser = SettingsParser;\n DateTimeFormatterBuilder.CharLiteralPrinterParser = StringLiteralPrinterParser;\n DateTimeFormatterBuilder.StringLiteralPrinterParser = StringLiteralPrinterParser;\n DateTimeFormatterBuilder.CharLiteralPrinterParser = CharLiteralPrinterParser;\n DateTimeFormatterBuilder.NumberPrinterParser = NumberPrinterParser;\n DateTimeFormatterBuilder.ReducedPrinterParser = ReducedPrinterParser;\n DateTimeFormatterBuilder.FractionPrinterParser = FractionPrinterParser;\n DateTimeFormatterBuilder.OffsetIdPrinterParser = OffsetIdPrinterParser;\n DateTimeFormatterBuilder.ZoneIdPrinterParser = ZoneIdPrinterParser;\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 {assert} from './assert';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {DateTimeException, IllegalArgumentException, UnsupportedTemporalTypeException} from './errors';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalQueries} from './temporal/TemporalQueries';\n\n/**\n * A month-of-year, such as 'July'.\n *\n * {@link Month} is representing the 12 months of the year -\n * January, February, March, April, May, June, July, August, September, October,\n * November and December.\n *\n * In addition to the textual name, each month-of-year has an `int` value.\n * The `int` value follows normal usage and the ISO-8601 standard,\n * from 1 (January) to 12 (December). It is recommended that applications use the static values defined by this class\n * rather than the `int` value to ensure code clarity.\n *\n * This class represents a common concept that is found in many calendar systems.\n * As such, this class may be used by any calendar system that has the month-of-year\n * concept defined exactly equivalent to the ISO-8601 calendar system.\n *\n * ### Static properties of Class {@link Month}\n *\n * Month.JANUARY, Month.FEBRUARY, Month.MARCH, Month.APRIL, Month.MAY, Month.JUNE,\n * Month.JULY, Month.AUGUST, Month.SEPTEMBER, Month.OCTOBER, Month.NOVEMBER, Month.DECEMBER\n *\n */\nexport class Month extends Temporal {\n\n /**\n *\n * @param {number} value\n * @private\n */\n constructor(value) {\n super();\n this._value = MathUtil.safeToInt(value);\n }\n\n /**\n *\n * @return {number} gets the value\n */\n value() {\n return this._value;\n }\n\n /**\n * Gets the textual representation, such as 'Jan' or 'December'.\n *\n * This returns the textual name used to identify the month-of-year.\n * The parameters control the length of the returned text and the locale.\n *\n * If no textual mapping is found then the numeric value (see {@link getValue}) 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 getDisplayName(style, locale) {\n // TODO:\n throw new IllegalArgumentException('Pattern using (localized) text not implemented yet!');\n //eslint-disable-next-line no-unreachable\n return new DateTimeFormatterBuilder().appendText(ChronoField.MONTH_OF_YEAR, style).toFormatter(locale).format(this);\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this month-of-year can be queried for the specified field.\n * If false, then calling the range (see {@link range}) and\n * get (see {@link get}) methods will throw an exception.\n *\n * If the field is MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) then\n * this method returns true.\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 month-of-year, false if not\n */\n isSupported(field) {\n if (null === field) {\n return false;\n }\n if (field instanceof ChronoField) {\n return field === ChronoField.MONTH_OF_YEAR;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this month-of-year as an `int`.\n *\n * This queries this month for the value of 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 MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) then the\n * value of the month-of-year, from 1 to 12, will be returned.\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, 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 if (field === ChronoField.MONTH_OF_YEAR) {\n return this.value();\n }\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this month-of-year as a `long`.\n *\n * This queries this month for the value of 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 MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) then the\n * value of the month-of-year, from 1 to 12, will be returned.\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 if (field === ChronoField.MONTH_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 * Returns the month-of-year that is the specified number of months after this one.\n *\n * The calculation rolls around the end of the year from December to January.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to add, positive or negative\n * @return {Month} the resulting month, not null\n */\n plus(months) {\n const amount = MathUtil.intMod(months, 12) + 12; // + 12 to make sure negative arguments are positive, the total is \"corrected\" by the next % 12\n let newMonthVal = MathUtil.intMod((this.value() + amount), 12);\n /* December is 12, not 0, but 12 % 12 = 0 */\n newMonthVal = newMonthVal === 0 ? 12 : newMonthVal;\n return Month.of(newMonthVal);\n }\n\n /**\n * Returns the month-of-year that is the specified number of months before this one.\n *\n * The calculation rolls around the start of the year from January to December.\n * The specified period may be negative.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} months - the months to subtract, positive or negative\n * @return {Month} the resulting month, not null\n */\n minus(months) {\n return this.plus(-1 * MathUtil.intMod(months, 12));\n }\n\n /**\n * Gets the length of this month in days.\n *\n * This takes a flag to determine whether to return the length for a leap year or not.\n *\n * February has 28 days in a standard year and 29 days in a leap year.\n * April, June, September and November have 30 days.\n * All other months have 31 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 28 to 31\n */\n length(leapYear) {\n switch (this) {\n case Month.FEBRUARY:\n return (leapYear ? 29 : 28);\n case Month.APRIL:\n case Month.JUNE:\n case Month.SEPTEMBER:\n case Month.NOVEMBER:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Gets the minimum length of this month in days.\n *\n * February has a minimum length of 28 days.\n * April, June, September and November have 30 days.\n * All other months have 31 days.\n *\n * @return {number} the minimum length of this month in days, from 28 to 31\n */\n minLength() {\n switch (this) {\n case Month.FEBRUARY:\n return 28;\n case Month.APRIL:\n case Month.JUNE:\n case Month.SEPTEMBER:\n case Month.NOVEMBER:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Gets the maximum length of this month in days.\n *\n * February has a maximum length of 29 days.\n * April, June, September and November have 30 days.\n * All other months have 31 days.\n *\n * @return {number} the maximum length of this month in days, from 29 to 31\n */\n maxLength() {\n switch (this) {\n case Month.FEBRUARY:\n return 29;\n case Month.APRIL:\n case Month.JUNE:\n case Month.SEPTEMBER:\n case Month.NOVEMBER:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Gets the day-of-year corresponding to the first day of this month.\n *\n * This returns the day-of-year that this month begins on, using the leap\n * year flag to determine the length of February.\n *\n * @param {boolean} leapYear - true if the length is required for a leap year\n * @return {number} the day of year corresponding to the first day of this month, from 1 to 336\n */\n firstDayOfYear(leapYear) {\n const leap = leapYear ? 1 : 0;\n switch (this) {\n case Month.JANUARY:\n return 1;\n case Month.FEBRUARY:\n return 32;\n case Month.MARCH:\n return 60 + leap;\n case Month.APRIL:\n return 91 + leap;\n case Month.MAY:\n return 121 + leap;\n case Month.JUNE:\n return 152 + leap;\n case Month.JULY:\n return 182 + leap;\n case Month.AUGUST:\n return 213 + leap;\n case Month.SEPTEMBER:\n return 244 + leap;\n case Month.OCTOBER:\n return 274 + leap;\n case Month.NOVEMBER:\n return 305 + leap;\n case Month.DECEMBER:\n default:\n return 335 + leap;\n }\n }\n\n /**\n * Gets the month corresponding to the first month of this quarter.\n *\n * The year can be divided into four quarters.\n * This method returns the first month of the quarter for the base month.\n * January, February and March return January.\n * April, May and June return April.\n * July, August and September return July.\n * October, November and December return October.\n *\n * @return {Month} the first month of the quarter corresponding to this month, not null\n */\n firstMonthOfQuarter() {\n switch (this) {\n case Month.JANUARY:\n case Month.FEBRUARY:\n case Month.MARCH:\n return Month.JANUARY;\n case Month.APRIL:\n case Month.MAY:\n case Month.JUNE:\n return Month.APRIL;\n case Month.JULY:\n case Month.AUGUST:\n case Month.SEPTEMBER:\n return Month.JULY;\n case Month.OCTOBER:\n case Month.NOVEMBER:\n case Month.DECEMBER:\n default:\n return Month.OCTOBER;\n }\n }\n\n /**\n * Queries this month-of-year using the specified query.\n *\n * This queries this month-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 assert(query != null, 'query() parameter must not be null', DateTimeException);\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.MONTHS;\n }\n return super.query(query);\n }\n\n\n\n /**\n * toString implementation... in JDK this is inherited from the Enum class\n *\n * @return {String}\n */\n toString() {\n switch (this) {\n case Month.JANUARY:\n return 'JANUARY';\n case Month.FEBRUARY:\n return 'FEBRUARY';\n case Month.MARCH:\n return 'MARCH';\n case Month.APRIL:\n return 'APRIL';\n case Month.MAY:\n return 'MAY';\n case Month.JUNE:\n return 'JUNE';\n case Month.JULY:\n return 'JULY';\n case Month.AUGUST:\n return 'AUGUST';\n case Month.SEPTEMBER:\n return 'SEPTEMBER';\n case Month.OCTOBER:\n return 'OCTOBER';\n case Month.NOVEMBER:\n return 'NOVEMBER';\n case Month.DECEMBER:\n return 'DECEMBER';\n default:\n return 'unknown Month, value: ' + this.value();\n }\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Adjusts the specified temporal object to have this month-of-year.\n *\n * This returns a temporal object of the same observable type as the input\n * with the month-of-year changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#MONTH_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 = thisMonth.adjustInto(temporal);\n * temporal = temporal.with(thisMonth);\n *\n *\n * For example, given a date in May, the following are output:\n *
\n * dateInMay.with(JANUARY); // four months earlier\n * dateInMay.with(APRIL); // one months earlier\n * dateInMay.with(MAY); // same date\n * dateInMay.with(JUNE); // one month later\n * dateInMay.with(DECEMBER); // seven 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 /* we support only ISO 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(ChronoField.MONTH_OF_YEAR, this.value());\n }\n\n /**\n * replacement for enum values\n * @return {Month[]}\n */\n static values(){\n return MONTHS.slice();\n }\n\n /**\n *\n * @param {number} month\n * @return {Month} not null\n **/\n static of(month) {\n if (month < 1 || month > 12) {\n assert(false, 'Invalid value for MonthOfYear: ' + month, DateTimeException);\n }\n return MONTHS[month-1];\n }\n\n /**\n * Obtains an instance of {@link Month} from a temporal object.\n *\n * This obtains a 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 Month}.\n *\n * The conversion extracts the MONTH_OF_YEAR (see {@link ChronoField#MONTH_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 Month::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {Month} the month-of-year, not null\n * @throws DateTimeException if unable to convert to a {@link Month}\n */\n static from(temporal) {\n if (temporal instanceof Month) {\n return temporal;\n }\n try {\n /* only ISO for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return Month.of(temporal.get(ChronoField.MONTH_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain Month from TemporalAccessor: ' +\n temporal + ' of type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''), ex);\n }\n }\n}\n\nlet MONTHS;\n\nexport function _init() {\n Month.JANUARY = new Month(1);\n Month.FEBRUARY = new Month(2);\n Month.MARCH = new Month(3);\n Month.APRIL = new Month(4);\n Month.MAY = new Month(5);\n Month.JUNE = new Month(6);\n Month.JULY = new Month(7);\n Month.AUGUST = new Month(8);\n Month.SEPTEMBER = new Month(9);\n Month.OCTOBER = new Month(10);\n Month.NOVEMBER = new Month(11);\n Month.DECEMBER = new Month(12);\n\n MONTHS = [\n Month.JANUARY, Month.FEBRUARY, Month.MARCH, Month.APRIL, Month.MAY, Month.JUNE,\n Month.JULY, Month.AUGUST, Month.SEPTEMBER, Month.OCTOBER, Month.NOVEMBER, Month.DECEMBER\n ];\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {Clock} from './Clock';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDate} from './LocalDate';\nimport {Month} from './Month';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalAccessor} from './temporal/TemporalAccessor';\nimport {TemporalQuery, createTemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {ValueRange} from './temporal/ValueRange';\nimport {Year} from './Year';\nimport {ZoneId} from './ZoneId';\n\n/**\n * A month-day in the ISO-8601 calendar system, such as `--12-03`.\n *\n * {@link MonthDay} is an immutable date-time object that represents the combination\n * of a year and month. Any field that can be derived from a month and day, such as\n * quarter-of-year, can be obtained.\n *\n * This class does not store or represent a year, time or time-zone.\n * For example, the value \"December 3rd\" can be stored in a {@link MonthDay}.\n *\n * Since a {@link MonthDay} does not possess a year, the leap day of\n * February 29th is considered valid.\n *\n * This class implements {@link TemporalAccessor} rather than {@link Temporal}.\n * This is because it is not possible to define whether February 29th is valid or not\n * without external information, preventing the implementation of plus/minus.\n * Related to this, {@link MonthDay} only provides access to query and set the fields\n * {@link MONTH_OF_YEAR} and {@link DAY_OF_MONTH}.\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 * ### Specification for implementors\n *\n * This class is immutable and thread-safe.\n */\nexport class MonthDay extends Temporal {\n /**\n * function overloading for {@link MonthDay.now}\n *\n * if called with 0 argument {@link MonthDay.now0} is executed,\n *\n * if called with 1 argument and first argument is an instance of ZoneId, then {@link MonthDay.nowZoneId} is executed,\n *\n * otherwise {@link MonthDay.nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @returns {MonthDay}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return MonthDay.now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return MonthDay.nowZoneId(zoneIdOrClock);\n } else {\n return MonthDay.nowClock(zoneIdOrClock);\n }\n }\n /**\n * Obtains the current month-day from the system clock in the default time-zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current month-day.\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 {MonthDay} the current month-day using the system clock and default time-zone, not null\n */\n static now0() {\n return this.nowClock(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current month-day from the system clock in the specified time-zone.\n *\n * This will query the system clock (see {@link Clock#system}) to obtain the current month-day.\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 {MonthDay} the current month-day using the system clock, not null\n */\n static nowZoneId(zone) {\n requireNonNull(zone, 'zone');\n return this.nowClock(Clock.system(zone));\n }\n\n /**\n * Obtains the current month-day from the specified clock.\n *\n * This will query the specified clock to obtain the current month-day.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection (see {@link Clock}).\n *\n * @param {Clock} clock the clock to use, not null\n * @return {MonthDay} the current month-day, not null\n */\n static nowClock(clock) {\n requireNonNull(clock, 'clock');\n const now = LocalDate.now(clock); // called once\n return MonthDay.of(now.month(), now.dayOfMonth());\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link MonthDay.of}\n *\n * if called with 2 argument and first argument is an instance of Month, then {@link MonthDay.ofMonthNumber} is executed,\n *\n * otherwise {@link MonthDay.ofNumberNumber} is executed\n *\n * @param {!(Month|number)} monthOrNumber\n * @param {?number} number\n * @returns {MonthDay}\n */\n static of(monthOrNumber, number) {\n if (arguments.length === 2 && monthOrNumber instanceof Month) {\n return MonthDay.ofMonthNumber(monthOrNumber, number);\n } else {\n return MonthDay.ofNumberNumber(monthOrNumber, number);\n }\n }\n /**\n * Obtains an instance of {@link MonthDay}.\n *\n * The day-of-month must be valid for the month within a leap year.\n * Hence, for February, day 29 is valid.\n *\n * For example, passing in April and day 31 will throw an exception, as\n * there can never be April 31st in any year. By contrast, passing in\n * February 29th is permitted, as that month-day can sometimes be valid.\n *\n * @param {Month} month the month-of-year to represent, not null\n * @param {number} dayOfMonth the day-of-month to represent, from 1 to 31\n * @return {MonthDay} the month-day, not null\n * @throws DateTimeException if the value of any field is out of range\n * @throws DateTimeException if the day-of-month is invalid for the month\n */\n static ofMonthNumber(month, dayOfMonth) {\n requireNonNull(month, 'month');\n ChronoField.DAY_OF_MONTH.checkValidValue(dayOfMonth);\n if (dayOfMonth > month.maxLength()) {\n throw new DateTimeException('Illegal value for DayOfMonth field, value ' + dayOfMonth +\n ' is not valid for month ' + month.toString());\n }\n return new MonthDay(month.value(), dayOfMonth);\n }\n\n /**\n * Obtains an instance of {@link MonthDay}.\n *\n * The day-of-month must be valid for the month within a leap year.\n * Hence, for month 2 (February), day 29 is valid.\n *\n * For example, passing in month 4 (April) and day 31 will throw an exception, as\n * there can never be April 31st in any year. By contrast, passing in\n * February 29th is permitted, as that month-day can sometimes be valid.\n *\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 * @return {MonthDay} the month-day, not null\n * @throws DateTimeException if the value of any field is out of range\n * @throws DateTimeException if the day-of-month is invalid for the month\n */\n static ofNumberNumber(month, dayOfMonth) {\n requireNonNull(month, 'month');\n requireNonNull(dayOfMonth, 'dayOfMonth');\n return MonthDay.of(Month.of(month), dayOfMonth);\n }\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link MonthDay} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link MonthDay}.\n *\n * The conversion extracts the MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) and\n * DAY_OF_MONTH (see {@link ChronoField#DAY_OF_MONTH}) fields.\n * The extraction is only permitted if the date-time has an ISO chronology.\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 MonthDay::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {MonthDay} the month-day, not null\n * @throws DateTimeException if unable to convert to a {@link MonthDay}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof MonthDay) {\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 MonthDay.of(temporal.get(ChronoField.MONTH_OF_YEAR), temporal.get(ChronoField.DAY_OF_MONTH));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain MonthDay from TemporalAccessor: ' +\n temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));\n }\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link MonthDay.parse}\n *\n * if called with 1 argument, then {@link MonthDay.parseString} is executed,\n *\n * otherwise {@link MonthDay.parseStringFormatter} is executed\n *\n * @param {!(String)} text\n * @param {?DateTimeFormatter} formatter\n * @returns {MonthDay}\n */\n static parse(text, formatter) {\n if (arguments.length === 1) {\n return MonthDay.parseString(text);\n } else {\n return MonthDay.parseStringFormatter(text, formatter);\n }\n }\n\n /**\n * Obtains an instance of {@link MonthDay} from a text string such as `--12-03`.\n *\n * The string must represent a valid month-day.\n * The format is `--MM-dd`.\n *\n * @param {String} text the text to parse such as \"--12-03\", not null\n * @return {MonthDay} the parsed month-day, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseString(text) {\n return MonthDay.parseStringFormatter(text, PARSER);\n }\n\n /**\n * Obtains an instance of {@link MonthDay} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a month-day.\n *\n * @param {String} text the text to parse, not null\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {MonthDay} the parsed month-day, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseStringFormatter(text, formatter) {\n requireNonNull(text, 'text');\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.parse(text, MonthDay.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} month the month-of-year to represent, validated from 1 to 12\n * @param {number} dayOfMonth the day-of-month to represent, validated from 1 to 29-31\n * @private\n */\n constructor(month, dayOfMonth) {\n super();\n this._month = MathUtil.safeToInt(month);\n this._day = MathUtil.safeToInt(dayOfMonth);\n }\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 getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #month()\n */\n monthValue() {\n return this._month;\n }\n\n /**\n * Gets the month-of-year field using the {@link 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 int value (see {@link Month#getValue}).\n *\n * @return {Month} the month-of-year, not null\n * @see #getMonthValue()\n */\n month() {\n return Month.of(this._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._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this month-day can be queried for the specified field.\n * If false, then calling the range (see {@link range}) and\n * get (see {@link get}) methods will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link MONTH_OF_YEAR}\n * * {@link 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 month-day, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.MONTH_OF_YEAR || field === ChronoField.DAY_OF_MONTH;\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 month-day 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 supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 */\n range(field) {\n if (field === ChronoField.MONTH_OF_YEAR) {\n return field.range();\n } else if (field === ChronoField.DAY_OF_MONTH) {\n return ValueRange.of(1, this.month().minLength(), this.month().maxLength());\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this month-day as an `int`.\n *\n * This queries this month-day 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 supported fields (see {@link isSupported}) will return valid\n * values based on this month-day.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 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 month-day as a `long`.\n *\n * This queries this month-day 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 supported fields (see {@link isSupported}) will return valid\n * values based on this month-day.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n // alignedDOW and alignedWOM not supported because they cannot be set in with()\n case ChronoField.DAY_OF_MONTH: return this._day;\n case ChronoField.MONTH_OF_YEAR: return this._month;\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is valid for this month-day.\n *\n * This method checks whether this month and day and the input year form\n * a valid date. This can only return false for February 29th.\n *\n * @param {number} year the year to validate, an out of range value returns false\n * @return {boolean} true if the year is valid for this month-day\n * @see Year#isValidMonthDay(MonthDay)\n */\n isValidYear(year) {\n return (this._day === 29 && this._month === 2 && Year.isLeap(year) === false) === false;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link MonthDay} with the month-of-year altered.\n *\n * This returns a month-day with the specified month.\n * If the day-of-month is invalid for the specified month, the day will\n * be adjusted to the last valid day-of-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 returned month-day, from 1 (January) to 12 (December)\n * @return {MonthDay} based on this month-day 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(Month.of(month));\n }\n\n /**\n * Returns a copy of this {@link MonthDay} with the month-of-year altered.\n *\n * This returns a month-day with the specified month.\n * If the day-of-month is invalid for the specified month, the day will\n * be adjusted to the last valid day-of-month.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Month} month the month-of-year to set in the returned month-day, not null\n * @return {MonthDay} based on this month-day with the requested month, not null\n */\n with(month) {\n requireNonNull(month, 'month');\n if (month.value() === this._month) {\n return this;\n }\n const day = Math.min(this._day, month.maxLength());\n return new MonthDay(month.value(), day);\n }\n\n /**\n * Returns a copy of this {@link MonthDay} with the day-of-month altered.\n *\n * This returns a month-day with the specified day-of-month.\n * If the day-of-month is invalid for the month, an exception is thrown.\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 return month-day, from 1 to 31\n * @return {MonthDay} based on this month-day with the requested day, not null\n * @throws DateTimeException if the day-of-month value is invalid\n * @throws DateTimeException if the day-of-month is invalid for the month\n */\n withDayOfMonth(dayOfMonth) {\n if (dayOfMonth === this._day) {\n return this;\n }\n return MonthDay.of(this._month, dayOfMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this month-day using the specified query.\n *\n * This queries this month-day 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 month-day.\n *\n * This returns a temporal object of the same observable type as the input\n * with the month and day-of-month changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * twice, passing {@link ChronoField#MONTH_OF_YEAR} and\n * {@link ChronoField#DAY_OF_MONTH} 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 = thisMonthDay.adjustInto(temporal);\n * temporal = temporal.with(thisMonthDay);\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 temporal = temporal.with(ChronoField.MONTH_OF_YEAR, this._month);\n return temporal.with(ChronoField.DAY_OF_MONTH, Math.min(temporal.range(ChronoField.DAY_OF_MONTH).maximum(), this._day));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this month-day with a year to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this month-day and the specified year.\n *\n * A month-day of February 29th will be adjusted to February 28th in the resulting\n * date if the year is not a leap year.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year the year to use, from MIN_YEAR to MAX_YEAR\n * @return {LocalDate} the local date formed from this month-day and the specified year, not null\n * @throws DateTimeException if the year is outside the valid range of years\n */\n atYear(year) {\n return LocalDate.of(year, this._month, this.isValidYear(year) ? this._day : 28);\n }\n //-----------------------------------------------------------------------\n /**\n * Compares this month-day to another month-day.\n *\n * The comparison is based first on value of the month, then on the value of the day.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {MonthDay} other the other month-day 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, MonthDay, 'other');\n let cmp = (this._month - other.monthValue());\n if (cmp === 0) {\n cmp = (this._day - other.dayOfMonth());\n }\n return cmp;\n }\n\n /**\n * Is this month-day after the specified month-day.\n *\n * @param {MonthDay} other the other month-day to compare to, not null\n * @return {boolean} true if this is after the specified month-day\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n requireInstance(other, MonthDay, 'other');\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this month-day before the specified month-day.\n *\n * @param {MonthDay} other the other month-day to compare to, not null\n * @return {boolean} true if this point is before the specified month-day\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n requireInstance(other, MonthDay, 'other');\n return this.compareTo(other) < 0;\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this month-day is equal to another month-day.\n *\n * The comparison is based on the time-line position of the month-day within a year.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other month-day\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof MonthDay) {\n const other = obj;\n return this.monthValue() === other.monthValue() && this.dayOfMonth() === other.dayOfMonth();\n }\n return false;\n }\n //-----------------------------------------------------------------------\n /**\n * Outputs this month-day as a string, such as `--12-03`.\n *\n * The output will be in the format `--MM-dd`:\n *\n * @return {String} a string representation of this month-day, not null\n */\n toString() {\n return '--'\n + (this._month < 10 ? '0' : '') + this._month\n + (this._day < 10 ? '-0' : '-') + this._day;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this month-day as a string using the formatter.\n *\n * This month-day will be passed to the formatter\n * print method (see {@link DateTimeFormatter#format}).\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted month-day string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.format(this);\n }\n\n}\n\nlet PARSER;\n\nexport function _init() {\n PARSER = new DateTimeFormatterBuilder()\n .appendLiteral('--')\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .appendLiteral('-')\n .appendValue(ChronoField.DAY_OF_MONTH, 2)\n .toFormatter();\n\n MonthDay.FROM = createTemporalQuery('MonthDay.FROM', (temporal) => {\n return MonthDay.from(temporal);\n });\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Clock} from './Clock';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDate} from './LocalDate';\nimport {Month} from './Month';\nimport {SignStyle} from './format/SignStyle';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalAmount} from './temporal/TemporalAmount';\nimport {TemporalField} from './temporal/TemporalField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {TemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalUnit} from './temporal/TemporalUnit';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {ValueRange} from './temporal/ValueRange';\nimport {Year} from './Year';\nimport {ZoneId} from './ZoneId';\n\n/**\n * A year-month in the ISO-8601 calendar system, such as `2007-12`.\n *\n * {@link YearMonth} is an immutable date-time object that represents the combination\n * of a year and month. Any field that can be derived from a year and month, such as\n * quarter-of-year, can be obtained.\n *\n * This class does not store or represent a day, time or time-zone.\n * For example, the value \"October 2007\" can be stored in a {@link YearMonth}.\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 * ### Specification for implementors\n *\n * This class is immutable and thread-safe.\n */\nexport class YearMonth extends Temporal {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.now}\n *\n * if called with 0 argument {@link YearMonth.now0} is executed,\n *\n * if called with 1 argument and first argument is an instance of ZoneId, then {@link YearMonth.nowZoneId} is executed,\n *\n * otherwise {@link YearMonth.nowClock} is executed\n *\n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @returns {YearMonth}\n */\n static now(zoneIdOrClock) {\n if (arguments.length === 0) {\n return YearMonth.now0();\n } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {\n return YearMonth.nowZoneId(zoneIdOrClock);\n } else {\n return YearMonth.nowClock(zoneIdOrClock);\n }\n }\n\n /**\n * Obtains the current year-month from the system clock in the default time-zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current year-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 {YearMonth} the current year-month using the system clock and default time-zone, not null\n */\n static now0() {\n return YearMonth.nowClock(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year-month from the system clock in the specified time-zone.\n *\n * This will query the system clock (see {@link Clock#system}) to obtain the current year-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 {YearMonth} the current year-month using the system clock, not null\n */\n static nowZoneId(zone) {\n return YearMonth.nowClock(Clock.system(zone));\n }\n\n /**\n * Obtains the current year-month from the specified clock.\n *\n * This will query the specified clock to obtain the current year-month.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock} clock the clock to use, not null\n * @return {YearMonth} the current year-month, not null\n */\n static nowClock(clock) {\n const now = LocalDate.now(clock);\n return YearMonth.of(now.year(), now.month());\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.of}\n *\n * if called with 2 argument and first argument is an instance of Month, then {@link YearMonth.ofNumberMonth} is executed,\n *\n * otherwise {@link YearMonth.ofNumberNumber} is executed\n *\n * @param {!number} year\n * @param {!(Month|number)} monthOrNumber\n * @returns {YearMonth}\n */\n static of(year, monthOrNumber) {\n if (arguments.length === 2 && monthOrNumber instanceof Month) {\n return YearMonth.ofNumberMonth(year, monthOrNumber);\n } else {\n return YearMonth.ofNumberNumber(year, monthOrNumber);\n }\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a year and month.\n *\n * @param {number} year the year to represent, from MIN_YEAR to MAX_YEAR\n * @param {Month} month the month-of-year to represent, not null\n * @return {YearMonth} the year-month, not null\n * @throws DateTimeException if the year value is invalid\n */\n static ofNumberMonth(year, month) {\n requireNonNull(month, 'month');\n requireInstance(month, Month, 'month');\n return YearMonth.ofNumberNumber(year, month.value());\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a year and month.\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 * @return {YearMonth} the year-month, not null\n * @throws DateTimeException if either field value is invalid\n */\n static ofNumberNumber(year, month) {\n requireNonNull(year, 'year');\n requireNonNull(month, 'month');\n ChronoField.YEAR.checkValidValue(year);\n ChronoField.MONTH_OF_YEAR.checkValidValue(month);\n return new YearMonth(year, month);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link YearMonth} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link YearMonth}.\n *\n * The conversion extracts the {@link ChronoField#YEAR} and\n * {@link ChronoField#MONTH_OF_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 YearMonth::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {YearMonth} the year-month, not null\n * @throws DateTimeException if unable to convert to a {@link YearMonth}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof YearMonth) {\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 YearMonth.of(temporal.get(ChronoField.YEAR), temporal.get(ChronoField.MONTH_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain YearMonth from TemporalAccessor: ' +\n temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));\n }\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.parse}\n *\n * if called with 2 argument and first argument is an instance of Month, then {@link YearMonth.parseString} is executed,\n *\n * otherwise {@link YearMonth.parseStringFormatter} is executed\n *\n * @param {!(String)} text\n * @param {?DateTimeFormatter} formatter\n * @returns {YearMonth}\n */\n static parse(text, formatter) {\n if (arguments.length === 1) {\n return YearMonth.parseString(text);\n } else {\n return YearMonth.parseStringFormatter(text, formatter);\n }\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a text string such as `2007-12`.\n *\n * The string must represent a valid year-month.\n * The format must be {@link yyyy-MM}.\n * Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.\n *\n * @param {String} text the text to parse such as \"2007-12\", not null\n * @return {YearMonth} the parsed year-month, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseString(text) {\n return YearMonth.parseStringFormatter(text, PARSER);\n }\n\n /**\n * Obtains an instance of {@link YearMonth} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a year-month.\n *\n * @param {String} text the text to parse, not null\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return the parsed year-month, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseStringFormatter(text, formatter) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, YearMonth.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 {number} month the month-of-year to represent, validated from 1 (January) to 12 (December)\n * @private\n */\n constructor(year, month) {\n super();\n this._year = MathUtil.safeToInt(year);\n this._month = MathUtil.safeToInt(month);\n }\n\n /**\n * function overloading for {@link YearMonth.isSupported}\n *\n * if called with 1 argument and first argument is an instance of TemporalField, then {@link YearMonth.isSupportedField} is executed,\n *\n * otherwise {@link YearMonth.isSupportedUnit} is executed\n *\n * @param {!(TemporalField|ChronoUnit)} fieldOrUnit\n * @returns {boolean}\n */\n isSupported(fieldOrUnit) {\n if (arguments.length === 1 && fieldOrUnit instanceof TemporalField) {\n return this.isSupportedField(fieldOrUnit);\n } else {\n return this.isSupportedUnit(fieldOrUnit);\n }\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this year-month can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link MONTH_OF_YEAR}\n * * {@link EPOCH_MONTH}\n * * {@link YEAR_OF_ERA}\n * * {@link YEAR}\n * * {@link ERA}\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 year-month, false if not\n */\n isSupportedField(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.YEAR || field === ChronoField.MONTH_OF_YEAR ||\n field === ChronoField.PROLEPTIC_MONTH || field === ChronoField.YEAR_OF_ERA || field === ChronoField.ERA;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n isSupportedUnit(unit) {\n if (unit instanceof ChronoUnit) {\n return unit === ChronoUnit.MONTHS || 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 * 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-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 supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 */\n range(field) {\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-month as an `int`.\n *\n * This queries this year-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 supported fields (see {@link isSupported}) will return valid\n * values based on this year-month, except {@link EPOCH_MONTH} which is too\n * large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 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-month as a `long`.\n *\n * This queries this year-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 supported fields (see {@link isSupported}) will return valid\n * values based on this year-month.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong( field) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.MONTH_OF_YEAR: return this._month;\n case ChronoField.PROLEPTIC_MONTH: return this._getProlepticMonth();\n case ChronoField.YEAR_OF_ERA: return (this._year < 1 ? 1 - this._year : this._year);\n case ChronoField.YEAR: return this._year;\n case ChronoField.ERA: return (this._year < 1 ? 0 : 1);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n _getProlepticMonth() {\n return MathUtil.safeAdd(MathUtil.safeMultiply(this._year, 12), (this._month - 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 {@link get}.\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 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 getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #getMonth()\n */\n monthValue() {\n return this._month;\n }\n\n /**\n * Gets the month-of-year field using the {@link 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, use {@link Month#getValue}.\n *\n * @return {Month} the month-of-year, not null\n */\n month() {\n return Month.of(this._month);\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-month is valid for this year-month.\n *\n * This method checks whether this year and month and the input day form\n * a valid date.\n *\n * @param {number} dayOfMonth the day-of-month to validate, from 1 to 31, invalid value returns false\n * @return {boolean} true if the day is valid for this year-month\n */\n isValidDay(dayOfMonth) {\n return dayOfMonth >= 1 && dayOfMonth <= this.lengthOfMonth();\n }\n\n /**\n * Returns the length of the month, taking account of the year.\n *\n * This returns the length of the month in days.\n * For example, a date in January would return 31.\n *\n * @return {number} the length of the month in days, from 28 to 31\n */\n lengthOfMonth() {\n return this.month().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 * function overloading for {@link YearMonth.with}\n *\n * if called with 1 argument, then {@link YearMonth.withAdjuster} is executed,\n *\n * if called with 2 arguments and first argument is an instance of TemporalField, then {@link YearMonth.withFieldValue} is executed,\n *\n * otherwise {@link YearMonth.withYearMonth} is executed\n *\n * @param {!(TemporalAdjuster|TemporalField|Number)} adjusterOrFieldOrNumber\n * @param {?number} value nullable only of first argument is an instance of TemporalAdjuster\n * @returns {YearMonth}\n */\n with(adjusterOrFieldOrNumber, value) {\n if (arguments.length === 1) {\n return this.withAdjuster(adjusterOrFieldOrNumber);\n } else if (arguments.length === 2 && adjusterOrFieldOrNumber instanceof TemporalField){\n return this.withFieldValue(adjusterOrFieldOrNumber, value);\n } else {\n return this.withYearMonth(adjusterOrFieldOrNumber, value);\n }\n }\n\n /**\n * Returns a copy of this year-month with the new year and month, 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 {number} newMonth the month-of-year to represent, validated not null\n * @return the year-month, not null\n */\n withYearMonth(newYear, newMonth) {\n requireNonNull(newYear);\n requireNonNull(newMonth);\n if (this._year === newYear && this._month === newMonth) {\n return this;\n }\n return new YearMonth(newYear, newMonth);\n }\n\n /**\n * Returns an adjusted copy of this year-month.\n *\n * This returns a new {@link YearMonth}, based on this one, with the year-month 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-month to the next month 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} 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 {YearMonth} 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 requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this year-month with the specified field set to a new value.\n *\n * This returns a new {@link YearMonth}, 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 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 * If the field is a {@link ChronoField} then the adjustment is implemented here.\n * The supported fields behave as follows:\n *\n * * {@link MONTH_OF_YEAR} -\n * Returns a {@link YearMonth} with the specified month-of-year.\n * The year will be unchanged.\n * * {@link PROLEPTIC_MONTH} -\n * Returns a {@link YearMonth} with the specified proleptic-month.\n * This completely replaces the year and month of this object.\n * * {@link YEAR_OF_ERA} -\n * Returns a {@link YearMonth} with the specified year-of-era\n * The month and era will be unchanged.\n * * {@link YEAR} -\n * Returns a {@link YearMonth} with the specified year.\n * The month will be unchanged.\n * * {@link ERA} -\n * Returns a {@link YearMonth} with the specified era.\n * The month 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 {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 a {@link YearMonth} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws ArithmeticException if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n const f = field;\n f.checkValidValue(newValue);\n switch (f) {\n case ChronoField.MONTH_OF_YEAR: return this.withMonth(newValue);\n case ChronoField.PROLEPTIC_MONTH: return this.plusMonths(newValue - this.getLong(ChronoField.PROLEPTIC_MONTH));\n case ChronoField.YEAR_OF_ERA: return this.withYear((this._year < 1 ? 1 - newValue : newValue));\n case ChronoField.YEAR: return this.withYear(newValue);\n case ChronoField.ERA: return (this.getLong(ChronoField.ERA) === newValue ? this : this.withYear(1 - this._year));\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link YearMonth} 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-month, from MIN_YEAR to MAX_YEAR\n * @return {YearMonth} based on this year-month 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.withYearMonth(year, this._month);\n }\n\n /**\n * Returns a copy of this {@link YearMonth} with the month-of-year altered.\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 returned year-month, from 1 (January) to 12 (December)\n * @return {YearMonth} based on this year-month with the requested month, not null\n * @throws DateTimeException if the month-of-year value is invalid\n */\n withMonth(month) {\n ChronoField.MONTH_OF_YEAR.checkValidValue(month);\n return this.withYearMonth(this._year, month);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.plus}\n *\n * if called with 1 arguments, then {@link YearMonth.plusAmount} is executed.\n *\n * Otherwise {@link YearMonth.plusAmountUnit} is executed.\n *\n * @param {!(TemporalAmount|number)} amountOrNumber\n * @param {?TemporalUnit} unit nullable only if first argument is an instance of TemporalAmount\n * @returns {YearMonth}\n */\n plus(amountOrNumber, unit) {\n if (arguments.length === 1) {\n return this.plusAmount(amountOrNumber);\n } else {\n return this.plusAmountUnit(amountOrNumber, unit);\n }\n }\n\n /**\n * Returns a copy of this year-month with the specified period added.\n *\n * This method returns a new year-month based on this year-month with the specified period added.\n * The adder is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to add, not null\n * @return {YearMonth} based on this year-month with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * @param {number} amountToAdd\n * @param {TemporalUnit} unit\n * @return {YearMonth} based on this year-month with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmountUnit(amountToAdd, unit) {\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.MONTHS: return this.plusMonths(amountToAdd);\n case ChronoUnit.YEARS: return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS: return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year-month 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 {YearMonth} based on this year-month 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.withYearMonth(newYear, this._month);\n }\n\n /**\n * Returns a copy of this year-month with the specified period in months added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} monthsToAdd the months to add, may be negative\n * @return {YearMonth} based on this year-month with the months added, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n plusMonths(monthsToAdd) {\n if (monthsToAdd === 0) {\n return this;\n }\n const monthCount = (this._year * 12) + (this._month - 1);\n const calcMonths = monthCount + monthsToAdd;\n const newYear = ChronoField.YEAR.checkValidIntValue(MathUtil.floorDiv(calcMonths, 12));\n const newMonth = MathUtil.floorMod(calcMonths, 12) + 1;\n return this.withYearMonth(newYear, newMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.minus}\n *\n * if called with 1 arguments, then {@link YearMonth.minusAmount} is executed.\n *\n * Otherwise {@link YearMonth.minusAmountUnit} is executed.\n *\n * @param {!(TemporalAmount|number)} amountOrNumber\n * @param {?TemporalUnit} unit\n * @returns {YearMonth}\n */\n minus(amountOrNumber, unit) {\n if (arguments.length === 1) {\n return this.minusAmount(amountOrNumber);\n } else {\n return this.minusAmountUnit(amountOrNumber, unit);\n }\n }\n\n /**\n * Returns a copy of this year-month with the specified period subtracted.\n *\n * This method returns a new year-month based on this year-month with the specified period subtracted.\n * The subtractor is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to subtract, not null\n * @return {YearMonth} based on this year-month with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * @param {number} amountToSubtract the amount to subtract, not null\n * @param {TemporalUnit} unit\n * @return {YearMonth} based on this year-month with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmountUnit(amountToSubtract, unit) {\n return (amountToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusAmountUnit(MathUtil.MAX_SAFE_INTEGER, unit).plusAmountUnit(1, unit) : this.plusAmountUnit(-amountToSubtract, unit));\n }\n\n /**\n * Returns a copy of this year-month 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 {YearMonth} based on this year-month 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-month with the specified period in months subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} monthsToSubtract the months to subtract, may be negative\n * @return {YearMonth} based on this year-month with the months subtracted, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n minusMonths(monthsToSubtract) {\n return (monthsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusMonths(Math.MAX_SAFE_INTEGER).plusMonths(1) : this.plusMonths(-monthsToSubtract));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year-month using the specified query.\n *\n * This queries this year-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 } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.MONTHS;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this year-month.\n *\n * This returns a temporal object of the same observable type as the input\n * with the year and month changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#PROLEPTIC_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 = thisYearMonth.adjustInto(temporal);\n * temporal = temporal.with(thisYearMonth);\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 requireInstance(temporal, 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.PROLEPTIC_MONTH, this._getProlepticMonth());\n }\n\n /**\n * Calculates the period between this year-month and another year-month in\n * terms of the specified unit.\n *\n * This calculates the period between two year-months in terms of a single unit.\n * The start and end points are `this` and the specified year-month.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link YearMonth}.\n * For example, the period in years between two year-months can be calculated\n * using {@link startYearMonth.until}.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two year-months.\n * For example, the period in decades between 2012-06 and 2032-05\n * will only be one decade as it is one month short of two decades.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n * long period = start.until(end, YEARS); // this method\n * dateTime.plus(YEARS.between(start, end)); // use in plus/minus\n *\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link MONTHS}, {@link YEARS}, {@link DECADES},\n * {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS} are supported.\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 input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive the end year-month, which is converted to a {@link YearMonth}, not null\n * @param {TemporalUnit} unit the unit to measure the period in, not null\n * @return {number} the amount of the period between this year-month and the end year-month\n * @throws DateTimeException if the period cannot be calculated\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 = YearMonth.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const monthsUntil = end._getProlepticMonth() - this._getProlepticMonth(); // no overflow\n switch (unit) {\n case ChronoUnit.MONTHS: return monthsUntil;\n case ChronoUnit.YEARS: return monthsUntil / 12;\n case ChronoUnit.DECADES: return monthsUntil / 120;\n case ChronoUnit.CENTURIES: return monthsUntil / 1200;\n case ChronoUnit.MILLENNIA: return monthsUntil / 12000;\n case ChronoUnit.ERAS: return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year-month with a day-of-month to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this year-month and the specified day-of-month.\n *\n * The day-of-month value must be valid for the year-month.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n * LocalDate date = year.atMonth(month).atDay(day);\n *\n *\n * @param {number} dayOfMonth the day-of-month to use, from 1 to 31\n * @return {LocalDate} the date formed from this year-month and the specified day, not null\n * @throws DateTimeException if the day is invalid for the year-month\n * @see #isValidDay(int)\n */\n atDay(dayOfMonth) {\n return LocalDate.of(this._year, this._month, dayOfMonth);\n }\n\n /**\n * Returns a {@link LocalDate} at the end of the month.\n *\n * This returns a {@link LocalDate} based on this year-month.\n * The day-of-month is set to the last valid day of the month, 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.atMonth(month).atEndOfMonth();\n *\n *\n * @return {LocalDate} the last valid date of this year-month, not null\n */\n atEndOfMonth() {\n return LocalDate.of(this._year, this._month, this.lengthOfMonth());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this year-month to another year-month.\n *\n * The comparison is based first on the value of the year, then on the value of the month.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {YearMonth} other the other year-month 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, YearMonth, 'other');\n let cmp = (this._year - other.year());\n if (cmp === 0) {\n cmp = (this._month - other.monthValue());\n }\n return cmp;\n }\n\n /**\n * Is this year-month after the specified year-month.\n *\n * @param {YearMonth} other the other year-month to compare to, not null\n * @return {boolean} true if this is after the specified year-month\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Is this year-month before the specified year-month.\n *\n * @param {YearMonth} other the other year-month to compare to, not null\n * @return {boolean} true if this point is before the specified year-month\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this year-month is equal to another year-month.\n *\n * The comparison is based on the time-line position of the year-months.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other year-month\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof YearMonth) {\n const other = obj;\n return this.year() === other.year() && this.monthValue() === other.monthValue();\n }\n return false;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this year-month as a string, such as `2007-12`.\n *\n * The output will be in the format {@link yyyy-MM}:\n *\n * @return {String} a string representation of this year-month, not null\n */\n toString() {\n return PARSER.format(this);\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this year-month as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted year-month 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\nlet PARSER;\n\nexport function _init() {\n\n PARSER = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .appendLiteral('-')\n .appendValue(ChronoField.MONTH_OF_YEAR, 2)\n .toFormatter();\n\n YearMonth.FROM = createTemporalQuery('YearMonth.FROM', (temporal) => {\n return YearMonth.from(temporal);\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, UnsupportedTemporalTypeException} from './errors';\nimport {requireNonNull, requireInstance} from './assert';\nimport {MathUtil} from './MathUtil';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Clock} from './Clock';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {LocalDate} from './LocalDate';\nimport {Month} from './Month';\nimport {MonthDay} from './MonthDay';\nimport {SignStyle} from './format/SignStyle';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalAccessor} from './temporal/TemporalAccessor';\nimport {TemporalAmount} from './temporal/TemporalAmount';\nimport {TemporalField} from './temporal/TemporalField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {TemporalQuery, createTemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalUnit} from './temporal/TemporalUnit';\nimport {YearConstants} from './YearConstants';\nimport {YearMonth} from './YearMonth';\nimport {ZoneId} from './ZoneId';\n\n\n/**\n * A year in the ISO-8601 calendar system, such as `2007`.\n *\n * {@link Year} is an immutable date-time object that represents a year.\n * Any field that can be derived from a year can be obtained.\n *\n * **Note that years in the ISO chronology only align with years in the\n * Gregorian-Julian system for modern years. Parts of Russia did not switch to the\n * modern Gregorian/ISO rules until 1920.\n * As such, historical years must be treated with caution.**\n *\n * This class does not store or represent a month, day, time or time-zone.\n * For example, the value \"2007\" can be stored in a {@link Year}.\n *\n * Years represented by this class follow the ISO-8601 standard and use\n * the proleptic numbering system. Year 1 is preceded by year 0, then by year -1.\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 * ### Static properties of Class {@link LocalDate}\n *\n * Year.MIN_VALUE = -999.999;\n *\n * The minimum supported year. Theoretically the minimum could be -28.542.4812 years in javascript.\n * approx LocalDateTime.ofEpochSecond(Number.MIN_SAFE_INTEGER, 0, ZoneOffset.UTC).year()\n *\n * Year.MAX_VALUE = 999.999;\n *\n * The maximum supported year. Theoretically the maximum could be 285.428.751 years in javascript.\n * approx LocalDateTime.ofEpochSecond(Number.MAX_SAFE_INTEGER, 0, ZoneOffset.UTC).year()\n *\n */\nexport class Year extends Temporal {\n\n /**\n *\n * @param {number} value\n * @private\n */\n constructor(value) {\n super();\n this._year = MathUtil.safeToInt(value);\n }\n\n /**\n *\n * @return {number} gets the value\n */\n value() {\n return this._year;\n }\n\n /**\n * function overloading for {@link Year.now}\n *\n * if called without arguments, then {@link Year.now0} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Year.nowZoneId} is executed.\n *\n * Otherwise {@link Year.nowClock} is executed.\n *\n * @param {!(ZoneId|Clock)} zoneIdOrClock\n * @returns {Year}\n */\n static now(zoneIdOrClock = undefined) {\n if (zoneIdOrClock === undefined) {\n return Year.now0();\n } else if (zoneIdOrClock instanceof ZoneId) {\n return Year.nowZoneId(zoneIdOrClock);\n } else {\n return Year.nowClock(zoneIdOrClock);\n }\n }\n\n /**\n * Obtains the current year from the system clock in the default time-zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current year.\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 {Year} the current year using the system clock and default time-zone, not null\n */\n static now0() {\n return Year.nowClock(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current year from the system clock in the specified time-zone.\n *\n * This will query the system clock (see {@link Clock#system}) to obtain the current 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 {Year} the current year using the system clock, not null\n */\n static nowZoneId(zone) {\n requireNonNull(zone, 'zone');\n requireInstance(zone, ZoneId, 'zone');\n return Year.nowClock(Clock.system(zone));\n }\n\n /**\n * Obtains the current year from the specified clock.\n *\n * This will query the specified clock to obtain the current year.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock} clock the clock to use, not null\n * @return {Year} the current year, not null\n */\n static nowClock(clock) {\n requireNonNull(clock, 'clock');\n requireInstance(clock, Clock, 'clock');\n const now = LocalDate.now(clock); // called once\n return Year.of(now.year());\n }\n /**\n * Obtains an instance of {@link Year}.\n *\n * This method accepts a year value from the proleptic ISO calendar system.\n *\n * * The year 2AD/CE is represented by 2.\n * * The year 1AD/CE is represented by 1.\n * * The year 1BC/BCE is represented by 0.\n * * The year 2BC/BCE is represented by -1.\n *\n * @param {Number} isoYear the ISO proleptic year to represent, from {@link MIN_VALUE} to {@link MAX_VALUE}\n * @return {Year} the year, not null\n * @throws DateTimeException if the field is invalid\n */\n static of(isoYear) {\n requireNonNull(isoYear, 'isoYear');\n ChronoField.YEAR.checkValidValue(isoYear);\n return new Year(isoYear);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link Year} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link Year}.\n *\n * The conversion extracts the {@link ChronoField#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 Year::from}.\n *\n * @param {TemporalAccessor} temporal the temporal object to convert, not null\n * @return {Year} the year, not null\n * @throws DateTimeException if unable to convert to a {@link Year}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof Year) {\n return temporal;\n }\n try {\n /* TODO: we support only ISO for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return Year.of(temporal.get(ChronoField.YEAR));\n } catch (ex) {\n throw new DateTimeException('Unable to obtain Year from TemporalAccessor: ' +\n temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));\n }\n }\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Year.parse}\n *\n * if called with 1 argument, then {@link Year.parseText} is executed.\n *\n * Otherwise {@link Year.parseTextFormatter} is executed.\n *\n * @param {!(String)} text\n * @param {?DateTimeFormatter} formatter\n * @returns {Year}\n */\n static parse(text, formatter) {\n if (arguments.length <= 1) {\n return Year.parseText(text);\n } else {\n return Year.parseTextFormatter(text, formatter);\n }\n }\n\n /**\n * Obtains an instance of {@link Year} from a text string such as `2007`.\n *\n * The string must represent a valid year.\n * Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.\n *\n * @param {String} text the text to parse such as \"2007\", not null\n * @return {Year} the parsed year, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseText(text) {\n requireNonNull(text, 'text');\n return Year.parse(text, PARSER);\n }\n\n /**\n * Obtains an instance of {@link Year} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a year.\n *\n * @param {String} text the text to parse, not null\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {Year} the parsed year, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parseTextFormatter(text, formatter = PARSER) {\n requireNonNull(text, 'text');\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.parse(text, Year.FROM);\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 * @param {number} year the year to check\n * @return {boolean} true if the year is leap, false otherwise\n */\n static isLeap(year) {\n return ((MathUtil.intMod(year, 4) === 0) && ((MathUtil.intMod(year, 100) !== 0) || (MathUtil.intMod(year, 400) === 0)));\n }\n\n /**\n * function overloading for {@link YearMonth.isSupported}\n *\n * if called with 1 argument and first argument is an instance of TemporalField, then {@link YearMonth.isSupportedField} is executed,\n *\n * otherwise {@link YearMonth.isSupportedUnit} is executed\n *\n * @param {!(TemporalField|ChronoUnit)} fieldOrUnit\n * @returns {boolean}\n */\n isSupported(fieldOrUnit) {\n if (arguments.length === 1 && fieldOrUnit instanceof TemporalField) {\n return this.isSupportedField(fieldOrUnit);\n } else {\n return this.isSupportedUnit(fieldOrUnit);\n }\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this year can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link YEAR_OF_ERA}\n * * {@link YEAR}\n * * {@link ERA}\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 year, false if not\n */\n isSupportedField(field) {\n 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 isSupportedUnit(unit) {\n 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 * 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 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 supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 */\n range(field) {\n if (this.isSupported(field)) {\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 year as an `int`.\n *\n * This queries this 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 supported fields (see {@link isSupported}) will return valid\n * values based on this year.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 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 as a `long`.\n *\n * This queries this 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 supported fields (see {@link isSupported}) will return valid\n * values based on this year.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.YEAR_OF_ERA: return (this._year < 1 ? 1 - this._year : this._year);\n case ChronoField.YEAR: return this._year;\n case ChronoField.ERA: return (this._year < 1 ? 0 : 1);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\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 isLeap() {\n return Year.isLeap(this._year);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link YearMonth.with}\n *\n * if called with 2 arguments and first argument is an instance of TemporalField, then {@link Year.withFieldValue} is executed,\n\n * otherwise {@link Year.withAdjuster} is executed,\n *\n * @param {!(TemporalAdjuster|TemporalField|Number)} adjusterOrFieldOrNumber\n * @param {?number} value nullable only of first argument is an instance of TemporalAdjuster\n * @returns {Year}\n */\n with(adjusterOrFieldOrNumber, value) {\n if (arguments.length === 2 && adjusterOrFieldOrNumber instanceof TemporalField) {\n return this.withFieldValue(adjusterOrFieldOrNumber, value);\n } else {\n return this.withAdjuster(adjusterOrFieldOrNumber);\n }\n }\n\n /**\n * Returns an adjusted copy of this year.\n *\n * This returns a new {@link Year}, based on this one, with the year 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 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 * @returns {Year} 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 requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this year with the specified field set to a new value.\n *\n * This returns a new {@link Year}, based on this one, with the value\n * for the specified field changed.\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 *\n * * {@link YEAR_OF_ERA} -\n * Returns a {@link Year} with the specified year-of-era\n * The era will be unchanged.\n * * {@link YEAR} -\n * Returns a {@link Year} with the specified year.\n * This completely replaces the date and is equivalent to {@link of}.\n * * {@link ERA} -\n * Returns a {@link Year} with the specified era.\n * The 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 {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 * @returns {Year} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws ArithmeticException if numeric overflow occurs\n */\n withFieldValue(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.YEAR_OF_ERA:\n return Year.of((this._year < 1 ? 1 - newValue : newValue));\n case ChronoField.YEAR:\n return Year.of(newValue);\n case ChronoField.ERA:\n return (this.getLong(ChronoField.ERA) === newValue ? this : Year.of(1 - this._year));\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * function overloading for {@link Year.plus}\n *\n * if called with 1 arguments, then {@link Year.plusAmount} is executed.\n *\n * Otherwise {@link Year.plusAmountToAddUnit} is executed.\n *\n * @param {!(TemporalAmount|number)} amountOrNumber\n * @param {?TemporalUnit} unit nullable only if first argument is an instance of TemporalAmount\n * @returns {Year}\n */\n plus(amountOrNumber, unit) {\n if (arguments.length === 1) {\n return this.plusAmount(amountOrNumber);\n } else {\n return this.plusAmountToAddUnit(amountOrNumber, unit);\n }\n }\n\n /**\n * Returns a copy of this year with the specified period added.\n *\n * This method returns a new year based on this year with the specified period added.\n * The adder is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to add, not null\n * @return {Year} based on this year with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * @param {number} amountToAdd\n * @param {TemporalUnit} unit\n * @return {Year} based on this year with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusAmountToAddUnit(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.YEARS: return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS: return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this year with the specified number of 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 {Year} based on this year with the period added, not null\n * @throws DateTimeException if the result exceeds the supported year range\n */\n plusYears(yearsToAdd) {\n if (yearsToAdd === 0) {\n return this;\n }\n return Year.of(ChronoField.YEAR.checkValidIntValue(MathUtil.safeAdd(this._year, yearsToAdd)));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Year.minus}\n *\n * if called with 1 argument, then {@link Year.minusAmount} is executed.\n *\n * Otherwise {@link Year.minusAmountToSubtractUnit} is executed.\n *\n * @param {!(TemporalAmount|number)} amountOrNumber\n * @param {?TemporalUnit} unit\n * @returns {Year}\n */\n minus(amountOrNumber, unit) {\n if (arguments.length === 1) {\n return this.minusAmount(amountOrNumber);\n } else {\n return this.minusAmountToSubtractUnit(amountOrNumber, unit);\n }\n }\n\n /**\n * Returns a copy of this year with the specified period subtracted.\n *\n * This method returns a new year based on this year with the specified period subtracted.\n * The subtractor is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount the amount to subtract, not null\n * @return {Year} based on this year with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmount(amount) {\n requireNonNull(amount, 'amount');\n requireInstance(amount, TemporalAmount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * @param {number} amountToSubtract the amount to subtract, not null\n * @param {TemporalUnit} unit\n * @return {Year} based on this year with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusAmountToSubtractUnit(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit, 'unit');\n return (amountToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plus(MathUtil.MAX_SAFE_INTEGER, unit).plus(1, unit) : this.plus(-amountToSubtract, unit));\n }\n\n /**\n * Returns a copy of this year with the specified number of 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 {Year} based on this year with the period subtracted, not null\n * @throws DateTimeException if the result exceeds the supported year range\n */\n minusYears(yearsToSubtract) {\n return (yearsToSubtract === MathUtil.MIN_SAFE_INTEGER ? this.plusYears(MathUtil.MAX_SAFE_INTEGER).plusYears(1) : this.plusYears(-yearsToSubtract));\n }\n\n /**\n * Adjusts the specified temporal object to have this year.\n *\n * This returns a temporal object of the same observable type as the input\n * with the year changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField#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 = thisYear.adjustInto(temporal);\n * temporal = temporal.with(thisYear);\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.YEAR, this._year);\n }\n\n /**\n * Checks if the month-day is valid for this year.\n *\n * This method checks whether this year and the input month and day form\n * a valid date.\n *\n * @param {MonthDay} monthDay the month-day to validate, null returns false\n * @return {boolean} true if the month and day are valid for this year\n */\n isValidMonthDay(monthDay) {\n return monthDay != null && monthDay.isValidYear(this._year);\n }\n\n /**\n * Gets the length of this year in days.\n *\n * @return {number} the length of this year in days, 365 or 366\n */\n length() {\n return this.isLeap() ? 366 : 365;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this year with a day-of-year to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this year and the specified day-of-year.\n *\n * The day-of-year value 366 is only valid in a leap year.\n *\n * @param {number} dayOfYear the day-of-year to use, not null\n * @return {LocalDate} the local date formed from this year and the specified date of year, not null\n * @throws DateTimeException if the day of year is zero or less, 366 or greater or equal\n * to 366 and this is not a leap year\n */\n atDay(dayOfYear) {\n return LocalDate.ofYearDay(this._year, dayOfYear);\n }\n\n /**\n * function overloading for {@link Year.atMonth}\n *\n * if called with 1 arguments and first argument is instance of Month, then {@link Year.atMonthMonth} is executed.\n *\n * Otherwise {@link Year.atMonthNumber} is executed.\n *\n * @param {Month|number} monthOrNumber\n * @returns {YearMonth}\n */\n atMonth(monthOrNumber) {\n if (arguments.length === 1 && monthOrNumber instanceof Month) {\n return this.atMonthMonth(monthOrNumber);\n } else {\n return this.atMonthNumber(monthOrNumber);\n }\n }\n\n /**\n * Combines this year with a month to create a {@link YearMonth}.\n *\n * This returns a {@link YearMonth} formed from this year and the specified month.\n * All possible combinations of year and month are valid.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n * LocalDate date = year.atMonth(month).atDay(day);\n *\n *\n * @param {Month} month the month-of-year to use, not null\n * @return {YearMonth} the year-month formed from this year and the specified month, not null\n */\n atMonthMonth(month) {\n requireNonNull(month, 'month');\n requireInstance(month, Month, 'month');\n return YearMonth.of(this._year, month);\n }\n\n /**\n * Combines this year with a month to create a {@link YearMonth}.\n *\n * This returns a {@link YearMonth} formed from this year and the specified month.\n * All possible combinations of year and month are valid.\n *\n * This method can be used as part of a chain to produce a date:\n *
\n * LocalDate date = year.atMonth(month).atDay(day);\n *\n *\n * @param {number} month the month-of-year to use, from 1 (January) to 12 (December)\n * @return {YearMonth} the year-month formed from this year and the specified month, not null\n * @throws DateTimeException if the month is invalid\n */\n atMonthNumber(month) {\n requireNonNull(month, 'month');\n return YearMonth.of(this._year, month);\n }\n\n /**\n * Combines this year with a month-day to create a {@link LocalDate}.\n *\n * This returns a {@link LocalDate} formed from this year and the specified month-day.\n *\n * A month-day of February 29th will be adjusted to February 28th in the resulting\n * date if the year is not a leap year.\n *\n * @param {MonthDay} monthDay the month-day to use, not null\n * @return {LocalDate} the local date formed from this year and the specified month-day, not null\n */\n atMonthDay(monthDay) {\n requireNonNull(monthDay, 'monthDay');\n requireInstance(monthDay, MonthDay, 'monthDay');\n return monthDay.atYear(this._year);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * Queries this year using the specified query.\n *\n * This queries this 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 } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.YEARS;\n } else if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {\n return null;\n }\n return super.query(query);\n }\n //-----------------------------------------------------------------------\n /**\n * Compares this year to another year.\n *\n * The comparison is based on the value of the year.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Year} other the other year 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, Year, 'other');\n return this._year - other._year;\n }\n\n /**\n * Is this year after the specified year.\n *\n * @param {Year} other the other year to compare to, not null\n * @return {boolean} true if this is after the specified year\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Year, 'other');\n return this._year > other._year;\n }\n\n /**\n * Is this year before the specified year.\n *\n * @param {Year} other the other year to compare to, not null\n * @return {boolean} true if this point is before the specified year\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Year, 'other');\n return this._year < other._year;\n }\n /**\n * Outputs this year as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted year string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n requireNonNull(formatter, 'formatter');\n requireInstance(formatter, DateTimeFormatter, 'formatter');\n return formatter.format(this);\n }\n\n /**\n * Checks if this year is equal to the specified {@link Year}.\n *\n * The comparison is based on the value\n *\n * @param {*} otherYear - the other year, null returns false\n * @return {boolean} true if the other duration is equal to this one\n */\n equals(otherYear) {\n if (this === otherYear) {\n return true;\n }\n if (otherYear instanceof Year) {\n return this.value() === otherYear.value();\n }\n return false;\n }\n /**\n * Outputs this year as a string.\n *\n * @return {String} a string representation of this year, not null\n */\n toString() {\n return '' + this._year;\n }\n\n /**\n * toJSON() use by JSON.stringify\n * delegates to toString()\n *\n * @return {string}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nlet PARSER;\n\nexport function _init() {\n\n Year.MIN_VALUE = YearConstants.MIN_VALUE;\n Year.MAX_VALUE = YearConstants.MAX_VALUE;\n\n PARSER = new DateTimeFormatterBuilder()\n .appendValue(ChronoField.YEAR, 4, 10, SignStyle.EXCEEDS_PAD)\n .toFormatter();\n\n Year.FROM = createTemporalQuery('Year.FROM', (temporal) => {\n return Year.from(temporal);\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 {abstractMethodFail} from '../assert';\n\n/**\n * Strategy for adjusting a temporal object.\n *\n * Adjusters are a key tool for modifying temporal objects.\n * They exist to externalize the process of adjustment, permitting different\n * approaches, as per the strategy design pattern.\n * Examples might be an adjuster that sets the date avoiding weekends, or one that\n * sets the date to the last day of the month.\n *\n * There are two equivalent ways of using a {@link TemporalAdjuster}.\n * The first is to invoke the method on this interface directly.\n * The second is to use {@link Temporal#with}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisAdjuster.adjustInto(temporal);\n * temporal = temporal.with(thisAdjuster);\n *\n * It is recommended to use the second approach, {@link with},\n * as it is a lot clearer to read in code.\n *\n * See {@link TemporalAdjusters} for a standard set of adjusters, including finding the\n * last day of the month.\n * Adjusters may also be defined by applications.\n *\n * ### Specification for implementors\n *\n * This interface places no restrictions on the mutability of implementations,\n * however immutability is strongly recommended.\n *\n * @interface\n */\nexport class TemporalAdjuster {\n\n /**\n * Adjusts the specified temporal object.\n *\n * This adjusts the specified temporal object using the logic\n * encapsulated in the implementing class.\n * Examples might be an adjuster that sets the date avoiding weekends, or one that\n * sets the date to the last day of the month.\n *\n * There are two equivalent ways of using this method.\n * The first is to invoke this method directly.\n * The second is to use {@link Temporal#with}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisAdjuster.adjustInto(temporal);\n * temporal = temporal.with(thisAdjuster);\n *\n * It is recommended to use the second approach, {@link with},\n * as it is a lot clearer to read in code.\n *\n * ### Specification for implementors\n *\n * The implementation must take the input object and adjust it.\n * The implementation defines the logic of the adjustment and is responsible for\n * documenting that logic. It may use any method on {@link Temporal} to\n * query the temporal object and perform the adjustment.\n * The returned object must have the same observable type as the input object\n *\n * The input object must not be altered.\n * Instead, an adjusted copy of the original must be returned.\n * This provides equivalent, safe behavior for immutable and mutable temporal objects.\n *\n * The input temporal object may be in a calendar system other than ISO.\n * Implementations may choose to document compatibility with other calendar systems,\n * or reject non-ISO temporal objects by querying the chronology (see {@link TemporalQueries#chronology}).\n *\n * This method may be called from multiple threads in parallel.\n * It must be thread-safe when invoked.\n *\n * @param {Temporal} temporal the temporal object to adjust, not null\n * @return {Temporal} an object of the same observable type with the adjustment made, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n *\n * @abstract\n */\n // eslint-disable-next-line no-unused-vars\n adjustInto(temporal){\n abstractMethodFail('adjustInto');\n }\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 {requireNonNull} from '../assert';\nimport {IllegalStateException} from '../errors';\n\nimport {TemporalAdjuster} from './TemporalAdjuster';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {MathUtil} from '../MathUtil';\n\n/**\n * Common implementations of {@link TemporalAdjuster}.\n *\n * This class provides common implementations of {@link TemporalAdjuster}.\n * They are especially useful to document the intent of business logic and\n * often link well to requirements.\n * For example, these two pieces of code do the same thing, but the second\n * one is clearer (assuming that there is a static import of this class):\n *
\n * // direct manipulation\n * date.withDayOfMonth(1).plusMonths(1).minusDays(1);\n * // use of an adjuster from this class\n * date.with(lastDayOfMonth());\n *\n * There are two equivalent ways of using a {@link TemporalAdjuster}.\n * The first is to invoke the method on the interface directly.\n * The second is to use {@link Temporal#with}:\n *
\n * // these two lines are equivalent, but the second approach is recommended\n * dateTime = adjuster.adjustInto(dateTime);\n * dateTime = dateTime.with(adjuster);\n *\n * It is recommended to use the second approach, {@link with},\n * as it is a lot clearer to read in code.\n *\n * ### Specification for implementors\n *\n * This is a thread-safe utility class.\n * All returned adjusters are immutable and thread-safe.\n *\n * The JDK 8 ofDateAdjuster(UnaryOperator) method is not backported.\n */\nexport class TemporalAdjusters {\n\n //-----------------------------------------------------------------------\n /**\n * Returns the 'first day of month' adjuster, which returns a new date set to\n * the first day of the current month.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-01-01.\n * * The input 2011-02-15 will return 2011-02-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n * temporal.with(DAY_OF_MONTH, 1);\n *\n *\n * @return {TemporalAdjuster} the first day-of-month adjuster, not null\n */\n static firstDayOfMonth() {\n return Impl.FIRST_DAY_OF_MONTH;\n }\n\n /**\n * Returns the 'last day of month' adjuster, which returns a new date set to\n * the last day of the current month.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-01-31.\n * * The input 2011-02-15 will return 2011-02-28.\n * * The input 2012-02-15 will return 2012-02-29 (leap year).\n * * The input 2011-04-15 will return 2011-04-30.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n * long lastDay = temporal.range(DAY_OF_MONTH).getMaximum();\n * temporal.with(DAY_OF_MONTH, lastDay);\n *\n *\n * @return {TemporalAdjuster} the last day-of-month adjuster, not null\n */\n static lastDayOfMonth() {\n return Impl.LAST_DAY_OF_MONTH;\n }\n\n /**\n * Returns the 'first day of next month' adjuster, which returns a new date set to\n * the first day of the next month.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-02-01.\n * * The input 2011-02-15 will return 2011-03-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n * temporal.with(DAY_OF_MONTH, 1).plus(1, MONTHS);\n *\n *\n * @return {TemporalAdjuster} the first day of next month adjuster, not null\n */\n static firstDayOfNextMonth() {\n return Impl.FIRST_DAY_OF_NEXT_MONTH;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the 'first day of year' adjuster, which returns a new date set to\n * the first day of the current year.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-01-01.\n * * The input 2011-02-15 will return 2011-01-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n * temporal.with(DAY_OF_YEAR, 1);\n *\n *\n * @return {TemporalAdjuster} the first day-of-year adjuster, not null\n */\n static firstDayOfYear() {\n return Impl.FIRST_DAY_OF_YEAR;\n }\n\n /**\n * Returns the 'last day of year' adjuster, which returns a new date set to\n * the last day of the current year.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2011-12-31.\n * * The input 2011-02-15 will return 2011-12-31.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n * long lastDay = temporal.range(DAY_OF_YEAR).getMaximum();\n * temporal.with(DAY_OF_YEAR, lastDay);\n *\n *\n * @return {TemporalAdjuster} the last day-of-year adjuster, not null\n */\n static lastDayOfYear() {\n return Impl.LAST_DAY_OF_YEAR;\n }\n\n /**\n * Returns the 'first day of next year' adjuster, which returns a new date set to\n * the first day of the next year.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 will return 2012-01-01.\n *\n * The behavior is suitable for use with most calendar systems.\n * It is equivalent to:\n *
\n * temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS);\n *\n *\n * @return {TemporalAdjuster} the first day of next month adjuster, not null\n */\n static firstDayOfNextYear() {\n return Impl.FIRST_DAY_OF_NEXT_YEAR;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the first in month adjuster, which returns a new date\n * in the same month with the first matching day-of-week.\n * This is used for expressions like 'first Tuesday in March'.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-12-15 for (MONDAY) will return 2011-12-05.\n * * The input 2011-12-15 for (FRIDAY) will return 2011-12-02.\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} and {@link DAY_OF_MONTH} fields\n * and the {@link DAYS} unit, and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week, not null\n * @return {TemporalAdjuster} the first in month adjuster, not null\n */\n static firstInMonth(dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n return new DayOfWeekInMonth(1, dayOfWeek);\n }\n\n /**\n * Returns the last in month adjuster, which returns a new date\n * in the same month with the last matching day-of-week.\n * This is used for expressions like 'last Tuesday in March'.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-12-15 for (MONDAY) will return 2011-12-26.\n * * The input 2011-12-15 for (FRIDAY) will return 2011-12-30.\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} and {@link DAY_OF_MONTH} fields\n * and the {@link DAYS} unit, and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week, not null\n * @return {TemporalAdjuster} the first in month adjuster, not null\n */\n static lastInMonth(dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n return new DayOfWeekInMonth(-1, dayOfWeek);\n }\n\n /**\n * Returns the day-of-week in month adjuster, which returns a new date\n * in the same month with the ordinal day-of-week.\n * This is used for expressions like the 'second Tuesday in March'.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-12-15 for (1,TUESDAY) will return 2011-12-06.\n * * The input 2011-12-15 for (2,TUESDAY) will return 2011-12-13.\n * * The input 2011-12-15 for (3,TUESDAY) will return 2011-12-20.\n * * The input 2011-12-15 for (4,TUESDAY) will return 2011-12-27.\n * * The input 2011-12-15 for (5,TUESDAY) will return 2012-01-03.\n * * The input 2011-12-15 for (-1,TUESDAY) will return 2011-12-27 (last in month).\n * * The input 2011-12-15 for (-4,TUESDAY) will return 2011-12-06 (3 weeks before last in month).\n * * The input 2011-12-15 for (-5,TUESDAY) will return 2011-11-29 (4 weeks before last in month).\n * * The input 2011-12-15 for (0,TUESDAY) will return 2011-11-29 (last in previous month).\n *\n * For a positive or zero ordinal, the algorithm is equivalent to finding the first\n * day-of-week that matches within the month and then adding a number of weeks to it.\n * For a negative ordinal, the algorithm is equivalent to finding the last\n * day-of-week that matches within the month and then subtracting a number of weeks to it.\n * The ordinal number of weeks is not validated and is interpreted leniently\n * according to this algorithm. This definition means that an ordinal of zero finds\n * the last matching day-of-week in the previous month.\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} and {@link DAY_OF_MONTH} fields\n * and the {@link DAYS} unit, and assumes a seven day week.\n *\n * @param {Number} ordinal the week within the month, unbounded but typically from -5 to 5\n * @param {DayOfWeek} dayOfWeek the day-of-week, not null\n * @return {TemporalAdjuster} the day-of-week in month adjuster, not null\n */\n static dayOfWeekInMonth(ordinal, dayOfWeek) {\n requireNonNull(dayOfWeek, 'dayOfWeek');\n return new DayOfWeekInMonth(ordinal, dayOfWeek);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns the next day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week after the date being adjusted.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two days later).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four days later).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-22 (seven days later).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to move the date to, not null\n * @return {TemporalAdjuster} the next day-of-week adjuster, not null\n */\n static next(dayOfWeek) {\n return new RelativeDayOfWeek(2, dayOfWeek);\n }\n\n /**\n * Returns the next-or-same day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week after the date being adjusted\n * unless it is already on that day in which case the same object is returned.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two days later).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four days later).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to check for or move the date to, not null\n * @return {TemporalAdjuster} the next-or-same day-of-week adjuster, not null\n */\n static nextOrSame(dayOfWeek) {\n return new RelativeDayOfWeek(0, dayOfWeek);\n }\n\n /**\n * Returns the previous day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week before the date being adjusted.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-08 (seven days earlier).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to move the date to, not null\n * @return {TemporalAdjuster} the previous day-of-week adjuster, not null\n */\n static previous(dayOfWeek) {\n return new RelativeDayOfWeek(3, dayOfWeek);\n }\n\n /**\n * Returns the previous-or-same day-of-week adjuster, which adjusts the date to the\n * first occurrence of the specified day-of-week before the date being adjusted\n * unless it is already on that day in which case the same object is returned.\n *\n * The ISO calendar system behaves as follows:\n *\n * * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).\n * * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input).\n *\n * The behavior is suitable for use with most calendar systems.\n * It uses the {@link DAY_OF_WEEK} field and the {@link DAYS} unit,\n * and assumes a seven day week.\n *\n * @param {DayOfWeek} dayOfWeek the day-of-week to check for or move the date to, not null\n * @return {TemporalAdjuster} the previous-or-same day-of-week adjuster, not null\n */\n static previousOrSame(dayOfWeek) {\n return new RelativeDayOfWeek(1, dayOfWeek);\n }\n\n}\n\n//-----------------------------------------------------------------------\n/**\n * Enum implementing the adjusters.\n */\nclass Impl extends TemporalAdjuster {\n\n /**\n *\n * @param ordinal\n * @private\n */\n constructor(ordinal) {\n super();\n this._ordinal = ordinal;\n }\n\n adjustInto(temporal) {\n switch (this._ordinal) {\n case 0: return temporal.with(ChronoField.DAY_OF_MONTH, 1);\n case 1: return temporal.with(ChronoField.DAY_OF_MONTH, temporal.range(ChronoField.DAY_OF_MONTH).maximum());\n case 2: return temporal.with(ChronoField.DAY_OF_MONTH, 1).plus(1, ChronoUnit.MONTHS);\n case 3: return temporal.with(ChronoField.DAY_OF_YEAR, 1);\n case 4: return temporal.with(ChronoField.DAY_OF_YEAR, temporal.range(ChronoField.DAY_OF_YEAR).maximum());\n case 5: return temporal.with(ChronoField.DAY_OF_YEAR, 1).plus(1, ChronoUnit.YEARS);\n }\n throw new IllegalStateException('Unreachable');\n }\n\n}\n\n/** First day of month adjuster. */\nImpl.FIRST_DAY_OF_MONTH = new Impl(0);\n/** Last day of month adjuster. */\nImpl.LAST_DAY_OF_MONTH = new Impl(1);\n/** First day of next month adjuster. */\nImpl.FIRST_DAY_OF_NEXT_MONTH = new Impl(2);\n/** First day of year adjuster. */\nImpl.FIRST_DAY_OF_YEAR = new Impl(3);\n/** Last day of year adjuster. */\nImpl.LAST_DAY_OF_YEAR = new Impl(4);\n/** First day of next month adjuster. */\nImpl.FIRST_DAY_OF_NEXT_YEAR = new Impl(5);\n\n\n/**\n * Class implementing day-of-week in month adjuster.\n */\nclass DayOfWeekInMonth extends TemporalAdjuster {\n\n /**\n *\n * @param ordinal\n * @param dow\n * @private\n */\n constructor(ordinal, dow) {\n super();\n this._ordinal = ordinal;\n this._dowValue = dow.value();\n }\n\n adjustInto(temporal) {\n if (this._ordinal >= 0) {\n const temp = temporal.with(ChronoField.DAY_OF_MONTH, 1);\n const curDow = temp.get(ChronoField.DAY_OF_WEEK);\n let dowDiff = MathUtil.intMod((this._dowValue - curDow + 7), 7);\n dowDiff += (this._ordinal - 1) * 7; // safe from overflow\n return temp.plus(dowDiff, ChronoUnit.DAYS);\n } else {\n const temp = temporal.with(ChronoField.DAY_OF_MONTH, temporal.range(ChronoField.DAY_OF_MONTH).maximum());\n const curDow = temp.get(ChronoField.DAY_OF_WEEK);\n let daysDiff = this._dowValue - curDow;\n daysDiff = (daysDiff === 0 ? 0 : (daysDiff > 0 ? daysDiff - 7 : daysDiff));\n daysDiff -= (-this._ordinal - 1) * 7; // safe from overflow\n return temp.plus(daysDiff, ChronoUnit.DAYS);\n }\n }\n}\n\n/**\n * Implementation of next, previous or current day-of-week.\n */\nclass RelativeDayOfWeek extends TemporalAdjuster {\n\n /**\n *\n * @param relative\n * @param dayOfWeek\n * @private\n */\n constructor(relative, dayOfWeek) {\n super();\n requireNonNull(dayOfWeek, 'dayOfWeek');\n /** Whether the current date is a valid answer. */\n this._relative = relative;\n /** The day-of-week value, from 1 to 7. */\n this._dowValue = dayOfWeek.value();\n }\n\n adjustInto(temporal) {\n const calDow = temporal.get(ChronoField.DAY_OF_WEEK);\n if (this._relative < 2 && calDow === this._dowValue) {\n return temporal;\n }\n if ((this._relative & 1) === 0) {\n const daysDiff = calDow - this._dowValue;\n return temporal.plus(daysDiff >= 0 ? 7 - daysDiff : -daysDiff, ChronoUnit.DAYS);\n } else {\n const daysDiff = this._dowValue - calDow;\n return temporal.minus(daysDiff >= 0 ? 7 - daysDiff : -daysDiff, ChronoUnit.DAYS);\n }\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 {Enum} from '../Enum';\nimport {requireNonNull} from '../assert';\nimport {DateTimeException} from '../errors';\nimport {MathUtil} from '../MathUtil';\n\nimport {DayOfWeek} from '../DayOfWeek';\nimport {LocalDate} from '../LocalDate';\nimport {Month} from '../Month';\nimport {Year} from '../Year';\n\nimport {ChronoField} from '../temporal/ChronoField';\nimport {ResolverStyle} from '../format/ResolverStyle';\nimport {TemporalAdjusters} from '../temporal/TemporalAdjusters';\n\nexport class IsoChronology extends Enum{\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 * @param {number} prolepticYear - the ISO proleptic year to check\n * @return {boolean} true if the year is leap, false otherwise\n */\n static isLeapYear(prolepticYear) {\n return ((prolepticYear & 3) === 0) && ((prolepticYear % 100) !== 0 || (prolepticYear % 400) === 0);\n }\n\n /**\n * Updates the map of field-values during resolution.\n *\n * @param {EnumMap} fieldValues the fieldValues map to update, not null\n * @param {ChronoField} field the field to update, not null\n * @param {number} value the value to update, not null\n * @throws DateTimeException if a conflict occurs\n */\n _updateResolveMap(fieldValues, field, value) {\n // TODO: this function is in Chronology in threetenbp, maybe needs to be moved?\n requireNonNull(fieldValues, 'fieldValues');\n requireNonNull(field, 'field');\n const current = fieldValues.get(field);\n if (current != null && current !== value) {\n throw new DateTimeException('Invalid state, field: ' + field + ' ' + current + ' conflicts with ' + field + ' ' + value);\n }\n fieldValues.put(field, value);\n }\n\n resolveDate(fieldValues, resolverStyle) {\n if (fieldValues.containsKey(ChronoField.EPOCH_DAY)) {\n return LocalDate.ofEpochDay(fieldValues.remove(ChronoField.EPOCH_DAY));\n }\n\n // normalize fields\n const prolepticMonth = fieldValues.remove(ChronoField.PROLEPTIC_MONTH);\n if (prolepticMonth != null) {\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.PROLEPTIC_MONTH.checkValidValue(prolepticMonth);\n }\n this._updateResolveMap(fieldValues, ChronoField.MONTH_OF_YEAR, MathUtil.floorMod(prolepticMonth, 12) + 1);\n this._updateResolveMap(fieldValues, ChronoField.YEAR, MathUtil.floorDiv(prolepticMonth, 12));\n }\n\n // eras\n const yoeLong = fieldValues.remove(ChronoField.YEAR_OF_ERA);\n if (yoeLong != null) {\n if (resolverStyle !== ResolverStyle.LENIENT) {\n ChronoField.YEAR_OF_ERA.checkValidValue(yoeLong);\n }\n const era = fieldValues.remove(ChronoField.ERA);\n if (era == null) {\n const year = fieldValues.get(ChronoField.YEAR);\n if (resolverStyle === ResolverStyle.STRICT) {\n // do not invent era if strict, but do cross-check with year\n if (year != null) {\n this._updateResolveMap(fieldValues, ChronoField.YEAR, (year > 0 ? yoeLong: MathUtil.safeSubtract(1, yoeLong)));\n } else {\n // reinstate the field removed earlier, no cross-check issues\n fieldValues.put(ChronoField.YEAR_OF_ERA, yoeLong);\n }\n } else {\n // invent era\n this._updateResolveMap(fieldValues, ChronoField.YEAR, (year == null || year > 0 ? yoeLong: MathUtil.safeSubtract(1, yoeLong)));\n }\n } else if (era === 1) {\n this._updateResolveMap(fieldValues, ChronoField.YEAR, yoeLong);\n } else if (era === 0) {\n this._updateResolveMap(fieldValues, ChronoField.YEAR, MathUtil.safeSubtract(1, yoeLong));\n } else {\n throw new DateTimeException('Invalid value for era: ' + era);\n }\n } else if (fieldValues.containsKey(ChronoField.ERA)) {\n ChronoField.ERA.checkValidValue(fieldValues.get(ChronoField.ERA)); // always validated\n }\n\n // build date\n if (fieldValues.containsKey(ChronoField.YEAR)) {\n if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR)) {\n if (fieldValues.containsKey(ChronoField.DAY_OF_MONTH)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n const moy = fieldValues.remove(ChronoField.MONTH_OF_YEAR);\n let dom = fieldValues.remove(ChronoField.DAY_OF_MONTH);\n if (resolverStyle === ResolverStyle.LENIENT) {\n const months = moy - 1;\n const days = dom - 1;\n return LocalDate.of(y, 1, 1).plusMonths(months).plusDays(days);\n } else if (resolverStyle === ResolverStyle.SMART){\n ChronoField.DAY_OF_MONTH.checkValidValue(dom);\n if (moy === 4 || moy === 6 || moy === 9 || moy === 11) {\n dom = Math.min(dom, 30);\n } else if (moy === 2) {\n dom = Math.min(dom, Month.FEBRUARY.length(Year.isLeap(y)));\n }\n return LocalDate.of(y, moy, dom);\n } else {\n return LocalDate.of(y, moy, dom);\n }\n }\n /*\n if (fieldValues.containsKey(ALIGNED_WEEK_OF_MONTH)) {\n if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_MONTH)) {\n int y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle == ResolverStyle.LENIENT) {\n long months = Jdk8Methods.safeSubtract(fieldValues.remove(ChronoField.MONTH_OF_YEAR), 1);\n long weeks = Jdk8Methods.safeSubtract(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1);\n long days = Jdk8Methods.safeSubtract(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), 1);\n return LocalDate.of(y, 1, 1).plusMonths(months).plusWeeks(weeks).plusDays(days);\n }\n int moy = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.MONTH_OF_YEAR));\n int aw = ALIGNED_WEEK_OF_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH));\n int ad = ALIGNED_DAY_OF_WEEK_IN_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH));\n LocalDate date = LocalDate.of(y, moy, 1).plusDays((aw - 1) * 7 + (ad - 1));\n if (resolverStyle == ResolverStyle.STRICT && date.get(ChronoField.MONTH_OF_YEAR) != moy) {\n throw new DateTimeException(\"Strict mode rejected date parsed to a different month\");\n }\n return date;\n }\n if (fieldValues.containsKey(DAY_OF_WEEK)) {\n int y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle == ResolverStyle.LENIENT) {\n long months = Jdk8Methods.safeSubtract(fieldValues.remove(ChronoField.MONTH_OF_YEAR), 1);\n long weeks = Jdk8Methods.safeSubtract(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1);\n long days = Jdk8Methods.safeSubtract(fieldValues.remove(DAY_OF_WEEK), 1);\n return LocalDate.of(y, 1, 1).plusMonths(months).plusWeeks(weeks).plusDays(days);\n }\n int moy = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.MONTH_OF_YEAR));\n int aw = ALIGNED_WEEK_OF_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH));\n int dow = DAY_OF_WEEK.checkValidIntValue(fieldValues.remove(DAY_OF_WEEK));\n LocalDate date = LocalDate.of(y, moy, 1).plusWeeks(aw - 1).with(nextOrSame(DayOfWeek.of(dow)));\n if (resolverStyle == ResolverStyle.STRICT && date.get(ChronoField.MONTH_OF_YEAR) != moy) {\n throw new DateTimeException(\"Strict mode rejected date parsed to a different month\");\n }\n return date;\n }\n }\n*/\n }\n if (fieldValues.containsKey(ChronoField.DAY_OF_YEAR)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle === ResolverStyle.LENIENT) {\n const days = MathUtil.safeSubtract(fieldValues.remove(ChronoField.DAY_OF_YEAR), 1);\n return LocalDate.ofYearDay(y, 1).plusDays(days);\n }\n const doy = ChronoField.DAY_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.DAY_OF_YEAR));\n return LocalDate.ofYearDay(y, doy);\n }\n if (fieldValues.containsKey(ChronoField.ALIGNED_WEEK_OF_YEAR)) {\n if (fieldValues.containsKey(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle === ResolverStyle.LENIENT) {\n const weeks = MathUtil.safeSubtract(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR), 1);\n const days = MathUtil.safeSubtract(fieldValues.remove(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR), 1);\n return LocalDate.of(y, 1, 1).plusWeeks(weeks).plusDays(days);\n }\n const aw = ChronoField.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR));\n const ad = ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR));\n const date = LocalDate.of(y, 1, 1).plusDays((aw - 1) * 7 + (ad - 1));\n if (resolverStyle === ResolverStyle.STRICT && date.get(ChronoField.YEAR) !== y) {\n throw new DateTimeException('Strict mode rejected date parsed to a different year');\n }\n return date;\n }\n if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK)) {\n const y = ChronoField.YEAR.checkValidIntValue(fieldValues.remove(ChronoField.YEAR));\n if (resolverStyle === ResolverStyle.LENIENT) {\n const weeks = MathUtil.safeSubtract(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR), 1);\n const days = MathUtil.safeSubtract(fieldValues.remove(ChronoField.DAY_OF_WEEK), 1);\n return LocalDate.of(y, 1, 1).plusWeeks(weeks).plusDays(days);\n }\n const aw = ChronoField.ALIGNED_WEEK_OF_YEAR.checkValidIntValue(fieldValues.remove(ChronoField.ALIGNED_WEEK_OF_YEAR));\n const dow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.remove(ChronoField.DAY_OF_WEEK));\n const date = LocalDate.of(y, 1, 1).plusWeeks(aw - 1).with(TemporalAdjusters.nextOrSame(DayOfWeek.of(dow)));\n if (resolverStyle === ResolverStyle.STRICT && date.get(ChronoField.YEAR) !== y) {\n throw new DateTimeException('Strict mode rejected date parsed to a different month');\n }\n return date;\n }\n }\n }\n return null;\n }\n\n /**\n * Obtains an ISO local date from another date-time object.\n *
\n * This is equivalent to {@link LocalDate#from(TemporalAccessor)}.\n *\n * @param temporal the date-time object to convert, not null\n * @return the ISO local date, not null\n * @throws DateTimeException if unable to create the date\n */\n date(temporal) {\n return LocalDate.from(temporal);\n }\n\n}\n\nexport function _init() {\n IsoChronology.INSTANCE = new IsoChronology('IsoChronology');\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 {requireNonNull} from '../assert';\nimport {Instant} from '../Instant';\nimport {LocalDate} from '../LocalDate';\nimport {MathUtil} from '../MathUtil';\n\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {Temporal} from '../temporal/Temporal';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\nexport class ChronoZonedDateTime extends Temporal {\n query(query) {\n if (query === TemporalQueries.zoneId() || query === TemporalQueries.zone()) {\n return this.zone();\n } else if (query === TemporalQueries.chronology()) {\n return this.toLocalDate().chronology();\n } else if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.offset()) {\n return this.offset();\n } else if (query === TemporalQueries.localDate()) {\n return LocalDate.ofEpochDay(this.toLocalDate().toEpochDay());\n } else if (query === TemporalQueries.localTime()) {\n return this.toLocalTime();\n }\n return super.query(query);\n }\n\n /**\n * Outputs this date-time as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted date-time 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 * Converts this date-time to an {@link Instant}.\n *\n * This returns an {@link Instant} representing the same point on the\n * time-line as this date-time. The calculation combines the\n * local date-time (see {@link toLocalDateTime}) and\n * offset (see {@link getOffset}).\n *\n * @return {Instant} an {@link Instant} representing the same instant, not null\n */\n toInstant() {\n return Instant.ofEpochSecond(this.toEpochSecond(), this.toLocalTime().nano());\n }\n\n /**\n * Converts this date-time to the number of seconds from the epoch\n * of 1970-01-01T00:00:00Z.\n *\n * This uses the local date-time (see {@link toLocalDateTime}) and\n * offset (see {@link getOffset}) to calculate the epoch-second value,\n * which is the number of elapsed seconds from 1970-01-01T00:00:00Z.\n * Instants on the time-line after the epoch are positive, earlier are negative.\n *\n * @return {number} the number of seconds from the epoch of 1970-01-01T00:00:00Z\n */\n toEpochSecond() {\n const epochDay = this.toLocalDate().toEpochDay();\n let secs = epochDay * 86400 + this.toLocalTime().toSecondOfDay();\n secs -= this.offset().totalSeconds();\n return secs;\n }\n\n /**\n * Compares this date-time to another date-time, including the chronology.\n *\n * The comparison is based first on the instant, then on the local date-time,\n * then on the zone ID, then on the chronology.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * If all the date-time objects being compared are in the same chronology, then the\n * additional chronology stage is not required.\n *\n * @param {ChronoZonedDateTime} other - the other date-time 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 let cmp = MathUtil.compareNumbers(this.toEpochSecond(), other.toEpochSecond());\n if (cmp === 0) {\n cmp = this.toLocalTime().nano() - other.toLocalTime().nano();\n if (cmp === 0) {\n cmp = this.toLocalDateTime().compareTo(other.toLocalDateTime());\n if (cmp === 0) {\n cmp = strcmp(this.zone().id(), other.zone().id());\n // we only support iso for now\n //if (cmp === 0) {\n // cmp = toLocalDate().getChronology().compareTo(other.toLocalDate().getChronology());\n //}\n }\n }\n }\n return cmp;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the instant of this date-time is after that of the specified date-time.\n *\n * This method differs from the comparison in {@link compareTo} in that it\n * only compares the instant of the date-time. This is equivalent to using\n * `dateTime1.toInstant().isAfter(dateTime2.toInstant())`.\n *\n * @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this is after the specified date-time\n */\n isAfter(other) {\n requireNonNull(other, 'other');\n const thisEpochSec = this.toEpochSecond();\n const otherEpochSec = other.toEpochSecond();\n return thisEpochSec > otherEpochSec ||\n (thisEpochSec === otherEpochSec && this.toLocalTime().nano() > other.toLocalTime().nano());\n }\n\n /**\n * Checks if the instant of this date-time is before that of the specified date-time.\n *\n * This method differs from the comparison in {@link compareTo} in that it\n * only compares the instant of the date-time. This is equivalent to using\n * `dateTime1.toInstant().isBefore(dateTime2.toInstant())`.\n *\n * @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this point is before the specified date-time\n */\n isBefore(other) {\n requireNonNull(other, 'other');\n const thisEpochSec = this.toEpochSecond();\n const otherEpochSec = other.toEpochSecond();\n return thisEpochSec < otherEpochSec ||\n (thisEpochSec === otherEpochSec && this.toLocalTime().nano() < other.toLocalTime().nano());\n }\n\n /**\n * Checks if the instant of this date-time is equal to that of the specified date-time.\n *\n * This method differs from the comparison in {@link compareTo} and {@link equals}\n * in that it only compares the instant of the date-time. This is equivalent to using\n * `dateTime1.toInstant().equals(dateTime2.toInstant())`.\n *\n * @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if the instant equals the instant of the specified date-time\n */\n isEqual(other) {\n requireNonNull(other, 'other');\n return this.toEpochSecond() === other.toEpochSecond() &&\n this.toLocalTime().nano() === other.toLocalTime().nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date-time is equal to another date-time.\n *\n * The comparison is based on the offset date-time and the zone.\n * To compare for the same instant on the time-line, use {@link compareTo}.\n * Only objects of type {@link ChronoZoneDateTime} are compared, other types return false.\n *\n * @param {*} other the object to check, null returns false\n * @return {boolean} true if this is equal to the other date-time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ChronoZonedDateTime) {\n return this.compareTo(other) === 0;\n }\n return false;\n }\n\n}\n\nfunction strcmp(a, b){\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\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 {requireNonNull} from './assert';\nimport {DateTimeException, IllegalArgumentException} from './errors';\nimport {MathUtil} from './MathUtil';\n\nimport {Clock} from './Clock';\nimport {Instant} from './Instant';\nimport {LocalDate} from './LocalDate';\nimport {LocalDateTime} from './LocalDateTime';\nimport {LocalTime} from './LocalTime';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\n\nimport {ChronoZonedDateTime} from './chrono/ChronoZonedDateTime';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {TemporalQueries} from './temporal/TemporalQueries';\n\n/**\n * A date-time with a time-zone in the ISO-8601 calendar system,\n * such as `2007-12-03T10:15:30+01:00 Europe/Paris`.\n *\n * `ZonedDateTime` is an immutable representation of a date-time with a time-zone.\n * This class stores all date and time fields, to a precision of nanoseconds,\n * and a time-zone, with a zone offset used to handle ambiguous local date-times.\n * For example, the value\n * '2nd October 2007 at 13:45.30.123456789 +02:00 in the Europe/Paris time-zone'\n * can be stored in a {@link ZonedDateTime}.\n *\n * This class handles conversion from the local time-line of {@link LocalDateTime}\n * to the instant time-line of {@link Instant}.\n * The difference between the two time-lines is the offset from UTC/Greenwich,\n * represented by a {@link ZoneOffset}.\n *\n * Converting between the two time-lines involves calculating the offset using the\n * {@link ZoneRules} rules accessed from the {@link ZoneId}.\n * Obtaining the offset for an instant is simple, as there is exactly one valid\n * offset for each instant. By contrast, obtaining the offset for a local date-time\n * is not straightforward. There are three cases:\n *\n * * Normal, with one valid offset. For the vast majority of the year, the normal\n * case applies, where there is a single valid offset for the local date-time.\n * * Gap, with zero valid offsets. This is when clocks jump forward typically\n * due to the spring daylight savings change from 'winter' to 'summer'.\n * In a gap there are local date-time values with no valid offset.\n * * Overlap, with two valid offsets. This is when clocks are set back typically\n * due to the autumn daylight savings change from 'summer' to 'winter'.\n * In an overlap there are local date-time values with two valid offsets.\n *\n * Any method that converts directly or implicitly from a local date-time to an\n * instant by obtaining the offset has the potential to be complicated.\n *\n * For Gaps, the general strategy is that if the local date-time falls in the\n * middle of a Gap, then the resulting zoned date-time will have a local date-time\n * shifted forwards by the length of the Gap, resulting in a date-time in the later\n * offset, typically 'summer' time.\n *\n * For Overlaps, the general strategy is that if the local date-time falls in the\n * middle of an Overlap, then the previous offset will be retained. If there is no\n * previous offset, or the previous offset is invalid, then the earlier offset is\n * used, typically 'summer' time. Two additional methods,\n * {@link withEarlierOffsetAtOverlap} and {@link withLaterOffsetAtOverlap},\n * help manage the case of an overlap.\n *\n * ### Specification for implementors\n *\n * A {@link ZonedDateTime} holds state equivalent to three separate objects,\n * a {@link LocalDateTime}, a {@link ZoneId} and the resolved {@link ZoneOffset}.\n * The offset and local date-time are used to define an instant when necessary.\n * The zone ID is used to obtain the rules for how and when the offset changes.\n * The offset cannot be freely set, as the zone controls which offsets are valid.\n */\nexport class ZonedDateTime extends ChronoZonedDateTime {\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current date-time from the system clock in the specified time-zone or clock\n * or default time zone.\n *\n * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default\n * time-zone to obtain the current date-time.\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 * @param {Clock|ZoneId} [clockOrZone=Clock.systemDefaultZone()]\n * @return {ZonedDateTime} the current date-time using the system clock, not null\n */\n static now(clockOrZone) {\n let clock;\n if(clockOrZone instanceof ZoneId){\n clock = Clock.system(clockOrZone);\n } else {\n clock = clockOrZone == null ? Clock.systemDefaultZone() : clockOrZone;\n }\n return ZonedDateTime.ofInstant(clock.instant(), clock.zone());\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for static {@link ZonedDateTime.of}\n *\n * if called with 2 (or less) args {@link ZonedDateTime.of2} is called,\n * if called with 3 args and the first arg is an instance of LocalDate {@link ZonedDateTime.of3} is called,\n * otherwise {@link ZonedDateTime.of8} is called.\n */\n static of(){\n if(arguments.length <= 2){\n return ZonedDateTime.of2.apply(this, arguments);\n } else if (arguments.length === 3 && arguments[0] instanceof LocalDate){\n return ZonedDateTime.of3.apply(this, arguments);\n } else {\n return ZonedDateTime.of8.apply(this, arguments);\n }\n }\n /**\n * Obtains an instance of {@link ZonedDateTime} from a local date and time.\n *\n * This creates a zoned date-time matching the input local date and time as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date time and first combined to form a local date-time.\n * The local date-time is then resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, when clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, when clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * @param {LocalDate} date - the local date, not null\n * @param {LocalTime} time - the local time, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the offset date-time, not null\n */\n static of3(date, time, zone) {\n return ZonedDateTime.of2(LocalDateTime.of(date, time), zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from a local date-time.\n *\n * This creates a zoned date-time matching the input local date-time as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, when clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, when clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * @param {!LocalDateTime} localDateTime - the local date-time, not null\n * @param {!ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static of2(localDateTime, zone) {\n return ZonedDateTime.ofLocal(localDateTime, zone, null);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from a year, month, day,\n * hour, minute, second, nanosecond and time-zone.\n *\n * This creates a zoned date-time matching the local date-time of the seven\n * specified fields as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, when clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, when clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\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 * {@link LocalDateTime} has five additional convenience variants of the\n * equivalent factory method taking fewer arguments.\n * They are not provided here to reduce the footprint of the API.\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 {number} hour - the hour-of-day to represent, from 0 to 23\n * @param {number} minute - the minute-of-hour to represent, from 0 to 59\n * @param {number} second - the second-of-minute to represent, from 0 to 59\n * @param {number} nanoOfSecond - the nano-of-second to represent, from 0 to 999,999,999\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime } the offset date-time, 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 */\n static of8(\n year, month, dayOfMonth,\n hour, minute, second, nanoOfSecond, zone) {\n const dt = LocalDateTime.of(year, month, dayOfMonth, hour, minute, second, nanoOfSecond);\n return ZonedDateTime.ofLocal(dt, zone, null);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from a local date-time\n * using the preferred offset if possible.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, where clocks are set back, there are two valid offsets.\n * If the preferred offset is one of the valid offsets then it is used.\n * Otherwise the earlier valid offset is used, typically corresponding to 'summer'.\n *\n * In the case of a gap, where clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * @param {!LocalDateTime} localDateTime - the local date-time, not null\n * @param {!ZoneId} zone - the time-zone, not null\n * @param {ZoneOffset} preferredOffset - the zone offset, null if no preference\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofLocal(localDateTime, zone, preferredOffset) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(zone, 'zone');\n if (zone instanceof ZoneOffset) {\n return new ZonedDateTime(localDateTime, zone, zone);\n }\n let offset = null;\n const rules = zone.rules();\n const validOffsets = rules.validOffsets(localDateTime);\n if (validOffsets.length === 1) {\n offset = validOffsets[0];\n } else if (validOffsets.length === 0) {\n const trans = rules.transition(localDateTime);\n localDateTime = localDateTime.plusSeconds(trans.duration().seconds());\n offset = trans.offsetAfter();\n } else {\n if (preferredOffset != null &&\n validOffsets.some((validOffset) => {return validOffset.equals(preferredOffset);})) {\n offset = preferredOffset;\n } else {\n offset = requireNonNull(validOffsets[0], 'offset'); // protect against bad ZoneRules\n }\n }\n\n return new ZonedDateTime(localDateTime, offset, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link ZonedDateTime.ofInstant}.\n * if called with 2 args {@link ZonedDateTime.ofInstant2} is called\n * otherwise {@link ZonedDateTime.ofInstant3}.\n */\n static ofInstant(){\n if (arguments.length === 2){\n return ZonedDateTime.ofInstant2.apply(this, arguments);\n } else {\n return ZonedDateTime.ofInstant3.apply(this, arguments);\n }\n }\n /**\n * Obtains an instance of {@link ZonedDateTime} from an {@link Instant}.\n *\n * This creates a zoned date-time with the same instant as that specified.\n * Calling {@link toInstant} will return an instant equal to the one used here.\n *\n * Converting an instant to a zoned date-time is simple as there is only one valid\n * offset for each instant.\n *\n * @param {!Instant} instant - the instant to create the date-time from, not null\n * @param {!ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n static ofInstant2(instant, zone) {\n requireNonNull(instant, 'instant');\n requireNonNull(zone, 'zone');\n return ZonedDateTime._create(instant.epochSecond(), instant.nano(), zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} from the instant formed by combining\n * the local date-time and offset.\n *\n * This creates a zoned date-time by combining the {@link LocalDateTime} and {@link ZoneOffset}.\n * This combination uniquely specifies an instant without ambiguity.\n *\n * Converting an instant to a zoned date-time is simple as there is only one valid\n * offset for each instant. If the valid offset is different to the offset specified,\n * the the date-time and offset of the zoned date-time will differ from those specified.\n *\n * If the {@link ZoneId} to be used is a {@link ZoneOffset}, this method is equivalent\n * to {@link of}.\n *\n * @param {LocalDateTime} localDateTime - the local date-time, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofInstant3(localDateTime, offset, zone) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n return ZonedDateTime._create(localDateTime.toEpochSecond(offset), localDateTime.nano(), zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} using seconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * @param {number} epochSecond - the number of seconds from the epoch of 1970-01-01T00:00:00Z\n * @param {number} nanoOfSecond - the nanosecond within the second, from 0 to 999,999,999\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n static _create(epochSecond, nanoOfSecond, zone) {\n const rules = zone.rules();\n const instant = Instant.ofEpochSecond(epochSecond, nanoOfSecond); // TODO: rules should be queryable by epochSeconds\n const offset = rules.offset(instant);\n const ldt = LocalDateTime.ofEpochSecond(epochSecond, nanoOfSecond, offset);\n return new ZonedDateTime(ldt, offset, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZonedDateTime} strictly validating the\n * combination of local date-time, offset and zone ID.\n *\n * This creates a zoned date-time ensuring that the offset is valid for the\n * local date-time according to the rules of the specified zone.\n * If the offset is invalid, an exception is thrown.\n *\n * @param {LocalDateTime} localDateTime - the local date-time, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofStrict(localDateTime, offset, zone) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n const rules = zone.rules();\n if (rules.isValidOffset(localDateTime, offset) === false) {\n const trans = rules.transition(localDateTime);\n if (trans != null && trans.isGap()) {\n // error message says daylight savings for simplicity\n // even though there are other kinds of gaps\n throw new DateTimeException('LocalDateTime ' + localDateTime +\n ' does not exist in zone ' + zone +\n ' due to a gap in the local time-line, typically caused by daylight savings');\n }\n throw new DateTimeException('ZoneOffset \"' + offset + '\" is not valid for LocalDateTime \"' +\n localDateTime + '\" in zone \"' + zone + '\"');\n }\n return new ZonedDateTime(localDateTime, offset, zone);\n }\n\n /**\n * Obtains an instance of {@link ZonedDateTime} leniently, for advanced use cases,\n * allowing any combination of local date-time, offset and zone ID.\n *\n * This creates a zoned date-time with no checks other than no nulls.\n * This means that the resulting zoned date-time may have an offset that is in conflict\n * with the zone ID.\n *\n * This method is intended for advanced use cases.\n * For example, consider the case where a zoned date-time with valid fields is created\n * and then stored in a database or serialization-based store. At some later point,\n * the object is then re-loaded. However, between those points in time, the government\n * that defined the time-zone has changed the rules, such that the originally stored\n * local date-time now does not occur. This method can be used to create the object\n * in an 'invalid' state, despite the change in rules.\n *\n * @param {LocalDateTime} localDateTime - the local date-time, not null\n * @param {ZoneOffset} offset - the zone offset, not null\n * @param {ZoneId} zone - the time-zone, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n static ofLenient(localDateTime, offset, zone) {\n requireNonNull(localDateTime, 'localDateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n if (zone instanceof ZoneOffset && offset.equals(zone) === false) {\n throw new IllegalArgumentException('ZoneId must match ZoneOffset');\n }\n return new ZonedDateTime(localDateTime, offset, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZonedDateTime} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link ZonedDateTime}.\n *\n * The conversion will first obtain a {@link ZoneId}. It will then try to obtain an instant.\n * If that fails it will try to obtain a local date-time.\n * The zoned date time will either be a combination of {@link ZoneId} and instant,\n * or {@link ZoneId} and local date-time.\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 ZonedDateTime::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n * @throws DateTimeException if unable to convert to an {@link ZonedDateTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n if (temporal instanceof ZonedDateTime) {\n return temporal;\n }\n const zone = ZoneId.from(temporal);\n if (temporal.isSupported(ChronoField.INSTANT_SECONDS)) {\n const zdt = ZonedDateTime._from(temporal, zone);\n if(zdt != null) return zdt;\n }\n const ldt = LocalDateTime.from(temporal);\n return ZonedDateTime.of2(ldt, zone);\n }\n\n static _from(temporal, zone){\n try {\n return ZonedDateTime.__from(temporal, zone);\n } catch (ex) {\n if(!(ex instanceof DateTimeException)) throw ex;\n // ignore\n }\n }\n\n static __from(temporal, zone){\n const epochSecond = temporal.getLong(ChronoField.INSTANT_SECONDS);\n const nanoOfSecond = temporal.get(ChronoField.NANO_OF_SECOND);\n return ZonedDateTime._create(epochSecond, nanoOfSecond, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link ZonedDateTime} from a text string such as\n * `2007-12-03T10:15:30+01:00[Europe/Paris]`.\n *\n * The string must represent a valid date-time and is parsed using\n * {@link org.threeten.bp.format.DateTimeFormatter#ISO_ZONED_DATE_TIME}.\n *\n * @param {!string} text - the text to parse such as '2007-12-03T10:15:30+01:00[Europe/Paris]', not null\n * @param {!DateTimeFormatter} [formatter=DateTimeFormatter.ISO_ZONED_DATE_TIME] - the formatter to use\n * @return {ZonedDateTime} the parsed zoned date-time, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_ZONED_DATE_TIME) {\n requireNonNull(formatter, 'fromatter');\n return formatter.parse(text, ZonedDateTime.FROM);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {LocalDateTime} dateTime - the date-time, validated as not null\n * @param {ZoneOffset} offset - the zone offset, validated as not null\n * @param {ZoneUd} zone - the time-zone, validated as not null\n * @private\n */\n constructor(dateTime, offset, zone) {\n requireNonNull(dateTime, 'dateTime');\n requireNonNull(offset, 'offset');\n requireNonNull(zone, 'zone');\n\n super();\n\n /**\n * The local date-time.\n */\n this._dateTime = dateTime;\n /**\n * The offset from UTC/Greenwich.\n */\n this._offset = offset;\n /**\n * The time-zone.\n */\n this._zone = zone;\n }\n\n /**\n * Resolves the new local date-time using this zone ID, retaining the offset if possible.\n *\n * @param {LocalDateTime} newDateTime - the new local date-time, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n _resolveLocal(newDateTime) {\n requireNonNull(newDateTime, 'newDateTime');\n return ZonedDateTime.ofLocal(newDateTime, this._zone, this._offset);\n }\n\n /**\n * Resolves the new local date-time using the offset to identify the instant.\n *\n * @param {LocalDateTime} newDateTime - the new local date-time, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n _resolveInstant(newDateTime) {\n return ZonedDateTime.ofInstant3(newDateTime, this._offset, this._zone);\n }\n\n /**\n * Resolves the offset into this zoned date-time.\n *\n * This ignores the offset, unless it can be used in an overlap.\n *\n * @param {ZoneOffset} offset - the offset, not null\n * @return {ZonedDateTime} the zoned date-time, not null\n */\n _resolveOffset(offset) {\n if (offset.equals(this._offset) === false && this._zone.rules().isValidOffset(this._dateTime, offset)) {\n return new ZonedDateTime(this._dateTime, offset, this._zone);\n }\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this date-time can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} 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 * * {@link NANO_OF_SECOND}\n * * {@link NANO_OF_DAY}\n * * {@link MICRO_OF_SECOND}\n * * {@link MICRO_OF_DAY}\n * * {@link MILLI_OF_SECOND}\n * * {@link MILLI_OF_DAY}\n * * {@link SECOND_OF_MINUTE}\n * * {@link SECOND_OF_DAY}\n * * {@link MINUTE_OF_HOUR}\n * * {@link MINUTE_OF_DAY}\n * * {@link HOUR_OF_AMPM}\n * * {@link CLOCK_HOUR_OF_AMPM}\n * * {@link HOUR_OF_DAY}\n * * {@link CLOCK_HOUR_OF_DAY}\n * * {@link AMPM_OF_DAY}\n * * {@link DAY_OF_WEEK}\n * * {@link ALIGNED_DAY_OF_WEEK_IN_MONTH}\n * * {@link ALIGNED_DAY_OF_WEEK_IN_YEAR}\n * * {@link DAY_OF_MONTH}\n * * {@link DAY_OF_YEAR}\n * * {@link EPOCH_DAY}\n * * {@link ALIGNED_WEEK_OF_MONTH}\n * * {@link ALIGNED_WEEK_OF_YEAR}\n * * {@link MONTH_OF_YEAR}\n * * {@link EPOCH_MONTH}\n * * {@link YEAR_OF_ERA}\n * * {@link YEAR}\n * * {@link ERA}\n * * {@link INSTANT_SECONDS}\n * * {@link OFFSET_SECONDS}\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|TemporalUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this date-time, false if not\n */\n isSupported(fieldOrUnit) {\n if(fieldOrUnit instanceof ChronoField){\n return true;\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isDateBased() || fieldOrUnit.isTimeBased();\n }\n return (fieldOrUnit != null && fieldOrUnit.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-time 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 supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 */\n range(field) {\n if (field instanceof ChronoField) {\n if (field === ChronoField.INSTANT_SECONDS || field === ChronoField.OFFSET_SECONDS) {\n return field.range();\n }\n return this._dateTime.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this date-time as an `int`.\n *\n * This queries this date-time 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 supported fields (see {@link isSupported}) will return valid\n * values based on this date-time, except {@link NANO_OF_DAY}, {@link MICRO_OF_DAY},\n * {@link EPOCH_DAY}, {@link EPOCH_MONTH} and {@link INSTANT_SECONDS} which are too\n * large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this date-time as a `long`.\n *\n * This queries this date-time 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 supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.INSTANT_SECONDS: return this.toEpochSecond();\n case ChronoField.OFFSET_SECONDS: return this._offset.totalSeconds();\n }\n return this._dateTime.getLong(field);\n }\n requireNonNull(field, 'field');\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-time 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 date-time changing the zone offset to the\n * earlier of the two valid offsets at a local time-line overlap.\n *\n * This method only has any effect when the local time-line overlaps, such as\n * at an autumn daylight savings cutover. In this scenario, there are two\n * valid offsets for the local date-time. Calling this method will return\n * a zoned date-time with the earlier of the two selected.\n *\n * If this method is called when it is not an overlap, `this`\n * is returned.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the earlier offset, not null\n */\n withEarlierOffsetAtOverlap() {\n const trans = this._zone.rules().transition(this._dateTime);\n if (trans != null && trans.isOverlap()) {\n const earlierOffset = trans.offsetBefore();\n if (earlierOffset.equals(this._offset) === false) {\n return new ZonedDateTime(this._dateTime, earlierOffset, this._zone);\n }\n }\n return this;\n }\n\n /**\n * Returns a copy of this date-time changing the zone offset to the\n * later of the two valid offsets at a local time-line overlap.\n *\n * This method only has any effect when the local time-line overlaps, such as\n * at an autumn daylight savings cutover. In this scenario, there are two\n * valid offsets for the local date-time. Calling this method will return\n * a zoned date-time with the later of the two selected.\n *\n * If this method is called when it is not an overlap, `this`\n * is returned.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the later offset, not null\n */\n withLaterOffsetAtOverlap() {\n const trans = this._zone.rules().transition(this.toLocalDateTime());\n if (trans != null) {\n const laterOffset = trans.offsetAfter();\n if (laterOffset.equals(this._offset) === false) {\n return new ZonedDateTime(this._dateTime, laterOffset, this._zone);\n }\n }\n return this;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the time-zone, such as 'Europe/Paris'.\n *\n * This returns the zone ID. This identifies the time-zone {@link ZoneRules}\n * that determine when and how the offset from UTC/Greenwich changes.\n *\n * The zone ID may be same as the offset (see {@link getOffset}).\n * If this is true, then any future calculations, such as addition or subtraction,\n * have no complex edge cases due to time-zone rules.\n * See also {@link withFixedOffsetZone}.\n *\n * @return {ZoneId} the time-zone, not null\n */\n zone() {\n return this._zone;\n }\n\n /**\n * Returns a copy of this date-time with a different time-zone,\n * retaining the local date-time if possible.\n *\n * This method changes the time-zone and retains the local date-time.\n * The local date-time is only changed if it is invalid for the new zone,\n * determined using the same approach as\n * {@link ofLocal}.\n *\n * To change the zone and adjust the local date-time,\n * use {@link withZoneSameInstant}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {ZoneId} zone - the time-zone to change to, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested zone, not null\n */\n withZoneSameLocal(zone) {\n requireNonNull(zone, 'zone');\n return this._zone.equals(zone) ? this : ZonedDateTime.ofLocal(this._dateTime, zone, this._offset);\n }\n\n /**\n * Returns a copy of this date-time with a different time-zone,\n * retaining the instant.\n *\n * This method changes the time-zone and retains the instant.\n * This normally results in a change to the local date-time.\n *\n * This method is based on retaining the same instant, thus gaps and overlaps\n * in the local time-line have no effect on the result.\n *\n * To change the offset while keeping the local time,\n * use {@link withZoneSameLocal}.\n *\n * @param {ZoneId} zone - the time-zone to change to, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested zone, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n withZoneSameInstant(zone) {\n requireNonNull(zone, 'zone');\n return this._zone.equals(zone) ? this :\n ZonedDateTime._create(this._dateTime.toEpochSecond(this._offset), this._dateTime.nano(), zone);\n }\n\n /**\n * Returns a copy of this date-time with the zone ID set to the offset.\n *\n * This returns a zoned date-time where the zone ID is the same as {@link getOffset}.\n * The local date-time, offset and instant of the result will be the same as in this date-time.\n *\n * Setting the date-time to a fixed single offset means that any future\n * calculations, such as addition or subtraction, have no complex edge cases\n * due to time-zone rules.\n * This might also be useful when sending a zoned date-time across a network,\n * as most protocols, such as ISO-8601, only handle offsets,\n * and not region-based zone IDs.\n *\n * This is equivalent to {@link ZonedDateTime.of}.\n *\n * @return {ZonedDateTime} a {@link ZonedDateTime} with the zone ID set to the offset, not null\n */\n withFixedOffsetZone() {\n return this._zone.equals(this._offset) ? this : new ZonedDateTime(this._dateTime, this._offset, this._offset);\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 {@link get}.\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._dateTime.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 getMonth}.\n *\n * @return {number} the month-of-year, from 1 to 12\n * @see #month()\n */\n monthValue() {\n return this._dateTime.monthValue();\n }\n\n /**\n * Gets the month-of-year field using the {@link 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, use {@link Month#getValue}.\n *\n * @return {Month} the month-of-year, not null\n * @see #getMonthValue()\n */\n month() {\n return this._dateTime.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._dateTime.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._dateTime.dayOfYear();\n }\n\n /**\n * Gets the day-of-week field, which is an enum {@link 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, use {@link DayOfWeek#getValue}.\n *\n * Additional information can be obtained from the {@link 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._dateTime.dayOfWeek();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the hour-of-day field.\n *\n * @return {number} the hour-of-day, from 0 to 23\n */\n hour() {\n return this._dateTime.hour();\n }\n\n /**\n * Gets the minute-of-hour field.\n *\n * @return {number} the minute-of-hour, from 0 to 59\n */\n minute() {\n return this._dateTime.minute();\n }\n\n /**\n * Gets the second-of-minute field.\n *\n * @return {number} the second-of-minute, from 0 to 59\n */\n second() {\n return this._dateTime.second();\n }\n\n /**\n * Gets the nano-of-second field.\n *\n * @return {number} the nano-of-second, from 0 to 999,999,999\n */\n nano() {\n return this._dateTime.nano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link ZonedDateTime.with}\n *\n * if called with 1 argument {@link ZonedDateTime.withTemporalAdjuster} is applied\n * otherwise {@link ZonedDateTime.with2}\n */\n with(){\n if(arguments.length === 1){\n return this.withTemporalAdjuster.apply(this, arguments);\n } else {\n return this.with2.apply(this, arguments);\n }\n }\n\n /**\n * Returns an adjusted copy of this date-time.\n *\n * This returns a new {@link ZonedDateTime}, based on this one, with the date-time 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 {@link 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 *
\n * import static org.threeten.bp.Month.*;\n * import static org.threeten.bp.temporal.Adjusters.*;\n *\n * result = zonedDateTime.with(JULY).with(lastDayOfMonth());\n *\n *\n * The classes {@link LocalDate} and {@link LocalTime} implement {@link TemporalAdjuster},\n * thus this method can be used to change the date, time or offset:\n *
\n * result = zonedDateTime.with(date);\n * result = zonedDateTime.with(time);\n *\n *\n * {@link ZoneOffset} also implements {@link TemporalAdjuster} however it is less likely\n * that setting the offset will have the effect you expect. When an offset is passed in,\n * the local date-time is combined with the new offset to form an {@link Instant}.\n * The instant and original zone are then used to create the result.\n * This algorithm means that it is quite likely that the output has a different offset\n * to the specified offset. It will however work correctly when passing in the offset\n * applicable for the instant of the zoned date-time, and will work correctly if passing\n * one of the two valid offsets during a daylight savings overlap when the same local time\n * occurs twice.\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 {ZonedDateTime} a {@link ZonedDateTime} 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 withTemporalAdjuster(adjuster) {\n // optimizations\n if (adjuster instanceof LocalDate) {\n return this._resolveLocal(LocalDateTime.of(adjuster, this._dateTime.toLocalTime()));\n } else if (adjuster instanceof LocalTime) {\n return this._resolveLocal(LocalDateTime.of(this._dateTime.toLocalDate(), adjuster));\n } else if (adjuster instanceof LocalDateTime) {\n return this._resolveLocal(adjuster);\n } else if (adjuster instanceof Instant) {\n const instant = adjuster;\n return ZonedDateTime._create(instant.epochSecond(), instant.nano(), this._zone);\n } else if (adjuster instanceof ZoneOffset) {\n return this._resolveOffset(adjuster);\n }\n requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified field set to a new value.\n *\n * This returns a {@link ZonedDateTime}, 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-time 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 {@link INSTANT_SECONDS} field will return a date-time with the specified instant.\n * The zone and nano-of-second are unchanged.\n * The result will have an offset derived from the new instant and original zone.\n * If the new instant value is outside the valid range then a {@link DateTimeException} will be thrown.\n *\n * The {@link OFFSET_SECONDS} field will typically be ignored.\n * The offset of a {@link ZonedDateTime} is controlled primarily by the time-zone.\n * As such, changing the offset does not generally make sense, because there is only\n * one valid offset for the local date-time and zone.\n * If the zoned date-time is in a daylight savings overlap, then the offset is used\n * to switch between the two valid offsets. In all other cases, the offset is ignored.\n * If the new offset value is outside the valid range then a {@link DateTimeException} will be thrown.\n *\n * The other supported fields (see {@link isSupported}) will behave as in {@link LocalDateTime#with}.\n * The zone is not part of the calculation and will be unchanged.\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\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.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 {ZonedDateTime} a {@link ZonedDateTime} 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 with2(field, newValue) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.INSTANT_SECONDS: return ZonedDateTime._create(newValue, this.nano(), this._zone);\n case ChronoField.OFFSET_SECONDS: {\n const offset = ZoneOffset.ofTotalSeconds(field.checkValidIntValue(newValue));\n return this._resolveOffset(offset);\n }\n }\n return this._resolveLocal(this._dateTime.with(field, newValue));\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the year value altered.\n *\n * This operates on the local time-line,\n * changing the year (see {@link LocalDateTime#withYear}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} year - the year to set in the result, from MIN_YEAR to MAX_YEAR\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested year, not null\n * @throws DateTimeException if the year value is invalid\n */\n withYear(year) {\n return this._resolveLocal(this._dateTime.withYear(year));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the month-of-year value altered.\n *\n * This operates on the local time-line,\n * changing the month (see {@link LocalDateTime#withMonth}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested month, not null\n * @throws DateTimeException if the month-of-year value is invalid\n */\n withMonth(month) {\n return this._resolveLocal(this._dateTime.withMonth(month));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the day-of-month value altered.\n *\n * This operates on the local time-line,\n * changing the day-of-month (see {@link LocalDateTime#withDayOfMonth}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested day, not null\n * @throws DateTimeException if the day-of-month value is invalid\n * @throws DateTimeException if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n return this._resolveLocal(this._dateTime.withDayOfMonth(dayOfMonth));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the day-of-year altered.\n *\n * This operates on the local time-line,\n * changing the day-of-year (see {@link LocalDateTime#withDayOfYear}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date with the requested day, not null\n * @throws DateTimeException if the day-of-year value is invalid\n * @throws DateTimeException if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n return this._resolveLocal(this._dateTime.withDayOfYear(dayOfYear));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the hour-of-day value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withHour}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hour - the hour-of-day to set in the result, from 0 to 23\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested hour, not null\n * @throws DateTimeException if the hour value is invalid\n */\n withHour(hour) {\n return this._resolveLocal(this._dateTime.withHour(hour));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the minute-of-hour value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withMinute}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minute - the minute-of-hour to set in the result, from 0 to 59\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested minute, not null\n * @throws DateTimeException if the minute value is invalid\n */\n withMinute(minute) {\n return this._resolveLocal(this._dateTime.withMinute(minute));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the second-of-minute value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withSecond}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} second - the second-of-minute to set in the result, from 0 to 59\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested second, not null\n * @throws DateTimeException if the second value is invalid\n */\n withSecond(second) {\n return this._resolveLocal(this._dateTime.withSecond(second));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the nano-of-second value altered.\n *\n * This operates on the local time-line,\n * changing the time (see {@link LocalDateTime#withNano}) of the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanoOfSecond - the nano-of-second to set in the result, from 0 to 999,999,999\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the requested nanosecond, not null\n * @throws DateTimeException if the nano value is invalid\n */\n withNano(nanoOfSecond) {\n return this._resolveLocal(this._dateTime.withNano(nanoOfSecond));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the time truncated.\n *\n * Truncation returns a copy of the original date-time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with {@link ChronoUnit#MINUTES}\n * will set the second-of-minute and nano-of-second field to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS}. Other units throw an exception.\n *\n * This operates on the local time-line, truncating the underlying local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalUnit} unit - the unit to truncate to, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the time truncated, not null\n * @throws DateTimeException if unable to truncate\n */\n truncatedTo(unit) {\n return this._resolveLocal(this._dateTime.truncatedTo(unit));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link ZonedDateTime.plus}\n *\n * if called with 1 argument {@link ZonedDateTime.plusTemporalAmount} is applied,\n * otherwise {@link ZonedDateTime.plus2}\n */\n plus(){\n if(arguments.length === 1){\n return this.plusTemporalAmount.apply(this, arguments);\n } else {\n return this.plus2.apply(this, arguments);\n }\n }\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this time with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!TemporalAmount} amount - the amount to add, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusTemporalAmount(amount) {\n requireNonNull(amount);\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this date-time with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * The calculation for date and time units differ.\n *\n * Date units operate on the local time-line.\n * The period is first added to the local date-time, then converted back\n * to a zoned date-time using the zone ID.\n * The conversion uses {@link ofLocal}\n * with the offset before the addition.\n *\n * Time units operate on the instant time-line.\n * The period is first added to the local date-time, then converted back to\n * a zoned date-time using the zone ID.\n * The conversion uses {@link ofInstant}\n * with the offset before 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 period to add, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the specified period added, not null\n * @throws DateTimeException if the unit cannot be added to this type\n */\n plus2(amountToAdd, unit) {\n if (unit instanceof ChronoUnit) {\n if (unit.isDateBased()) {\n return this._resolveLocal(this._dateTime.plus(amountToAdd, unit));\n } else {\n return this._resolveInstant(this._dateTime.plus(amountToAdd, unit));\n }\n }\n requireNonNull(unit, 'unit');\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in years added.\n *\n * This operates on the local time-line, adding years to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the years added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusYears(years) {\n return this._resolveLocal(this._dateTime.plusYears(years));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in months added.\n *\n * This operates on the local time-line, adding months to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the months added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusMonths(months) {\n return this._resolveLocal(this._dateTime.plusMonths(months));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in weeks added.\n *\n * This operates on the local time-line, adding weeks to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime}a {@link ZonedDateTime} based on this date-time with the weeks added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusWeeks(weeks) {\n return this._resolveLocal(this._dateTime.plusWeeks(weeks));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in days added.\n *\n * This operates on the local time-line, adding days to the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime}a {@link ZonedDateTime} based on this date-time with the days added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusDays(days) {\n return this._resolveLocal(this._dateTime.plusDays(days));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in hours added.\n *\n * This operates on the instant time-line, such that adding one hour will\n * always be a duration of one hour later.\n * This may cause the local date-time to change by an amount other than one hour.\n * Note that this is a different approach to that used by days, months and years,\n * thus adding one day is not the same as adding 24 hours.\n *\n * For example, consider a time-zone where the spring DST cutover means that the\n * local times 01:00 to 01:59 occur twice changing from offset +02:00 to +01:00.\n *\n * * Adding one hour to 00:30+02:00 will result in 01:30+02:00\n * * Adding one hour to 01:30+02:00 will result in 01:30+01:00\n * * Adding one hour to 01:30+01:00 will result in 02:30+01:00\n * * Adding three hours to 00:30+02:00 will result in 02:30+01:00\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the hours added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusHours(hours) {\n return this._resolveInstant(this._dateTime.plusHours(hours));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in minutes added.\n *\n * This operates on the instant time-line, such that adding one minute will\n * always be a duration of one minute later.\n * This may cause the local date-time to change by an amount other than one minute.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the minutes added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusMinutes(minutes) {\n return this._resolveInstant(this._dateTime.plusMinutes(minutes));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in seconds added.\n *\n * This operates on the instant time-line, such that adding one second will\n * always be a duration of one second later.\n * This may cause the local date-time to change by an amount other than one second.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the seconds added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusSeconds(seconds) {\n return this._resolveInstant(this._dateTime.plusSeconds(seconds));\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in nanoseconds added.\n *\n * This operates on the instant time-line, such that adding one nano will\n * always be a duration of one nano later.\n * This may cause the local date-time to change by an amount other than one nano.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanos - the nanos to add, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the nanoseconds added, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n plusNanos(nanos) {\n return this._resolveInstant(this._dateTime.plusNanos(nanos));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link ZonedDateTime.minus}\n *\n * if called with 1 argument {@link ZonedDateTime.minusTemporalAmount} is applied,\n * otherwise {@link ZonedDateTime.minus2}\n */\n minus(){\n if(arguments.length === 1){\n return this.minusTemporalAmount.apply(this, arguments);\n } else {\n return this.minus2.apply(this, arguments);\n }\n }\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this time with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusTemporalAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this date-time with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\n *\n * The calculation for date and time units differ.\n *\n * Date units operate on the local time-line.\n * The period is first subtracted from the local date-time, then converted back\n * to a zoned date-time using the zone ID.\n * The conversion uses {@link ofLocal}\n * with the offset before the subtraction.\n *\n * Time units operate on the instant time-line.\n * The period is first subtracted from the local date-time, then converted back to\n * a zoned date-time using the zone ID.\n * The conversion uses {@link ofInstant}\n * with the offset before the subtraction.\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 period to subtract, not null\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the specified period subtracted, not null\n * @throws DateTimeException if the unit cannot be added to this type\n */\n minus2(amountToSubtract, unit) {\n return this.plus2(-1 * amountToSubtract, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in years subtracted.\n *\n * This operates on the local time-line, subtracting years from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the years subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusYears(years) {\n return this.plusYears(-1 * years);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in months subtracted.\n *\n * This operates on the local time-line, subtracting months from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the months subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusMonths(months) {\n return this.plusMonths(-1 * months);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in weeks subtracted.\n *\n * This operates on the local time-line, subtracting weeks from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the weeks subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusWeeks(weeks) {\n return this.plusWeeks(-1 * weeks);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in days subtracted.\n *\n * This operates on the local time-line, subtracting days from the local date-time.\n * This is then converted back to a {@link ZonedDateTime}, using the zone ID\n * to obtain the offset.\n *\n * When converting back to {@link ZonedDateTime}, if the local date-time is in an overlap,\n * then the offset will be retained if possible, otherwise the earlier offset will be used.\n * If in a gap, the local date-time will be adjusted forward by the length of the gap.\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 {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the days subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusDays(days) {\n return this.plusDays(-1 * days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in hours subtracted.\n *\n * This operates on the instant time-line, such that subtracting one hour will\n * always be a duration of one hour earlier.\n * This may cause the local date-time to change by an amount other than one hour.\n * Note that this is a different approach to that used by days, months and years,\n * thus subtracting one day is not the same as adding 24 hours.\n *\n * For example, consider a time-zone where the spring DST cutover means that the\n * local times 01:00 to 01:59 occur twice changing from offset +02:00 to +01:00.\n *\n * * Subtracting one hour from 02:30+01:00 will result in 01:30+02:00\n * * Subtracting one hour from 01:30+01:00 will result in 01:30+02:00\n * * Subtracting one hour from 01:30+02:00 will result in 00:30+01:00\n * * Subtracting three hours from 02:30+01:00 will result in 00:30+02:00\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the hours subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusHours(hours) {\n return this.plusHours(-1 * hours);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in minutes subtracted.\n *\n * This operates on the instant time-line, such that subtracting one minute will\n * always be a duration of one minute earlier.\n * This may cause the local date-time to change by an amount other than one minute.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the minutes subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusMinutes(minutes) {\n return this.plusMinutes(-1 * minutes);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in seconds subtracted.\n *\n * This operates on the instant time-line, such that subtracting one second will\n * always be a duration of one second earlier.\n * This may cause the local date-time to change by an amount other than one second.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the seconds subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusSeconds(seconds) {\n return this.plusSeconds(-1 * seconds);\n }\n\n /**\n * Returns a copy of this {@link ZonedDateTime} with the specified period in nanoseconds subtracted.\n *\n * This operates on the instant time-line, such that subtracting one nano will\n * always be a duration of one nano earlier.\n * This may cause the local date-time to change by an amount other than one nano.\n * Note that this is a different approach to that used by days, months and years.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanos - the nanos to subtract, may be negative\n * @return {ZonedDateTime} a {@link ZonedDateTime} based on this date-time with the nanoseconds subtracted, not null\n * @throws DateTimeException if the result exceeds the supported date range\n */\n minusNanos(nanos) {\n return this.plusNanos(-1 * nanos);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this date-time using the specified query.\n *\n * This queries this date-time 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 if (query === TemporalQueries.localDate()) {\n return this.toLocalDate();\n }\n requireNonNull(query, 'query');\n return super.query(query);\n }\n\n /**\n * Calculates the period between this date-time and another date-time in\n * terms of the specified unit.\n *\n * This calculates the period between two date-times in terms of a single unit.\n * The start and end points are `this` and the specified date-time.\n * The result will be negative if the end is before the start.\n * For example, the period in days between two date-times can be calculated\n * using {@link startDateTime.until}.\n *\n * The {@link Temporal} passed to this method must be a {@link ZonedDateTime}.\n * If the time-zone differs between the two zoned date-times, the specified\n * end date-time is normalized to have the same zone as this date-time.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two date-times.\n * For example, the period in months between 2012-06-15T00:00Z and 2012-08-14T23:59Z\n * will only be one month as it is one minute short of two months.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n * long period = start.until(end, MONTHS); // this method\n * dateTime.plus(MONTHS.between(start, end)); // use in plus/minus\n *\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link NANOS}, {@link MICROS}, {@link MILLIS}, {@link SECONDS},\n * {@link MINUTES}, {@link HOURS} and {@link HALF_DAYS}, {@link DAYS},\n * {@link WEEKS}, {@link MONTHS}, {@link YEARS}, {@link DECADES},\n * {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS} are supported.\n * Other {@link ChronoUnit} values will throw an exception.\n *\n * The calculation for date and time units differ.\n *\n * Date units operate on the local time-line, using the local date-time.\n * For example, the period from noon on day 1 to noon the following day\n * in days will always be counted as exactly one day, irrespective of whether\n * there was a daylight savings change or not.\n *\n * Time units operate on the instant time-line.\n * The calculation effectively converts both zoned date-times to instants\n * and then calculates the period between the instants.\n * For example, the period from noon on day 1 to noon the following day\n * in hours may be 23, 24 or 25 hours (or some other amount) depending on\n * whether there was a daylight savings change or not.\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 input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive the end date-time, which is converted to a {@link ZonedDateTime}, not null\n * @param {TemporalUnit} unit the unit to measure the period in, not null\n * @return {number} the amount of the period between this date-time and the end date-time\n * @throws DateTimeException if the period cannot be calculated\n * @throws ArithmeticException if numeric overflow occurs\n */\n until(endExclusive, unit) {\n let end = ZonedDateTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n end = end.withZoneSameInstant(this._zone);\n if (unit.isDateBased()) {\n return this._dateTime.until(end._dateTime, unit);\n } else {\n const difference = this._offset.totalSeconds() - end._offset.totalSeconds();\n const adjustedEnd = end._dateTime.plusSeconds(difference);\n return this._dateTime.until(adjustedEnd, unit);\n }\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the {@link LocalDateTime} part of this date-time.\n *\n * This returns a {@link LocalDateTime} with the same year, month, day and time\n * as this date-time.\n *\n * @return {LocalDateTime} the local date-time part of this date-time, not null\n */\n toLocalDateTime() {\n return this._dateTime;\n }\n\n /**\n * Gets the {@link LocalDate} part of this date-time.\n *\n * This returns a {@link LocalDate} with the same year, month and day\n * as this date-time.\n *\n * @return {LocalDate} the date part of this date-time, not null\n */\n toLocalDate() {\n return this._dateTime.toLocalDate();\n }\n\n /**\n * Gets the {@link LocalTime} part of this date-time.\n *\n * This returns a {@link LocalTime} with the same hour, minute, second and\n * nanosecond as this date-time.\n *\n * @return {LocalTime} the time part of this date-time, not null\n */\n toLocalTime() {\n return this._dateTime.toLocalTime();\n }\n\n /**\n * Converts this date-time to an {@link OffsetDateTime}.\n *\n * This creates an offset date-time using the local date-time and offset.\n * The zone ID is ignored.\n *\n * @return {OffsetDateTime} an offset date-time representing the same local date-time and offset, not null\n */\n /**\n * we will not support OffsetDateTime in the near future\n toOffsetDateTime() {\n return OffsetDateTime.of(this._dateTime, this._offset);\n }\n */\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date-time is equal to another date-time.\n *\n * The comparison is based on the offset date-time and the zone.\n * Only objects of type {@link ZonedDateTime} are compared, other types return false.\n *\n * @param {*} other the object to check, null returns false\n * @return {boolean} true if this is equal to the other date-time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof ZonedDateTime) {\n return this._dateTime.equals(other._dateTime) &&\n this._offset.equals(other._offset) &&\n this._zone.equals(other._zone);\n }\n return false;\n }\n\n /**\n * A hash code for this date-time.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._dateTime.hashCode(), this._offset.hashCode(), this._zone.hashCode());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this date-time as a string, such as\n * `2007-12-03T10:15:30+01:00[Europe/Paris]`.\n *\n * The format consists of the {@link LocalDateTime} followed by the {@link ZoneOffset}.\n * If the {@link ZoneId} is not the same as the offset, then the ID is output.\n * The output is compatible with ISO-8601 if the offset and ID are the same.\n *\n * @return {string} a string representation of this date-time, not null\n */\n toString() {\n let str = this._dateTime.toString() + this._offset.toString();\n if (this._offset !== this._zone) {\n str += '[' + this._zone.toString() + ']';\n }\n return str;\n }\n\n /**\n *\n * @return {string} same as {@link ZonedDateTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this date-time as a string using the formatter.\n *\n * @param {DateTimeFormatter} formatter the formatter to use, not null\n * @return {string} the formatted date-time string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n format(formatter) {\n return super.format(formatter);\n }\n\n}\n\nexport function _init(){\n ZonedDateTime.FROM = createTemporalQuery('ZonedDateTime.FROM', (temporal) => {\n return ZonedDateTime.from(temporal);\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 {assert, requireNonNull, requireInstance} from './assert';\n\nimport {MathUtil} from './MathUtil';\nimport {DateTimeException, UnsupportedTemporalTypeException, NullPointerException, IllegalArgumentException} from './errors';\n\nimport {IsoChronology} from './chrono/IsoChronology';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {ChronoLocalDate} from './chrono/ChronoLocalDate';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {ValueRange} from './temporal/ValueRange';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\n\nimport {Clock} from './Clock';\nimport {DayOfWeek} from './DayOfWeek';\nimport {Month} from './Month';\nimport {Period} from './Period';\nimport {YearConstants} from './YearConstants';\nimport {LocalTime} from './LocalTime';\nimport {LocalDateTime} from './LocalDateTime';\nimport {Year} from './Year';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\nimport {ZonedDateTime} from './ZonedDateTime';\n\n/**\n * The number of days in a 400 year cycle.\n */\nconst DAYS_PER_CYCLE = 146097;\n\n/**\n* The number of days from year zero to year 1970.\n* There are five 400 year cycles from year zero to 2000.\n* There are 7 leap years from 1970 to 2000.\n*/\nconst DAYS_0000_TO_1970 = (DAYS_PER_CYCLE * 5) - (30 * 365 + 7);\n\n/**\n * A date without a time-zone in the ISO-8601 calendar system,\n * such as 2007-12-03.\n *\n * LocalDate is an immutable date-time object that represents a date,\n * often viewed as year-month-day. Other date fields, such as day-of-year,\n * day-of-week and week-of-year, can also be accessed.\n * For example, the value \"2nd October 2007\" can be stored in a LocalDate.\n *\n * This class does not store or represent a time or time-zone.\n * Instead, it is a description of the date, as used for birthdays.\n * It cannot represent an instant on the time-line without additional information\n * such as an offset or time-zone.\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 * ### Static properties of Class {@link LocalDate}\n *\n * LocalDate.MIN = LocalDate.of(Year.MIN_VALUE, 1, 1);\n *\n * The minimum supported {@link LocalDate}\n * This could be used by an application as a \"far past\" date.\n *\n * LocalDate.MAX = LocalDate.of(Year.MAX_VALUE, 12, 31);\n *\n * The maximum supported {@link LocalDate}\n * This could be used by an application as a \"far future\" date.\n *\n * LocalDate.EPOCH_0\n *\n * The date at epoch day 0, that is 1970-01-01.\n */\n\nexport class LocalDate extends ChronoLocalDate{\n\n /**\n * Obtains the current date from the system clock in the default time-zone or\n * if specified, the current date from the specified clock or\n * if argument is a ZoneId this will query a clock with the specified ZoneId.\n *\n * This will query the specified clock to obtain the current date - today.\n * Using this method allows the use of an alternate clock for testing.\n *\n * @param {Clock|ZoneId} [clockOrZone=Clock.systemDefaultZone()] - the clock or zone to use,\n * if null, the system clock and default time-zone is used.\n * @return {LocalDate} the current date, not null\n */\n static now(clockOrZone) {\n let clock;\n if(clockOrZone == null){\n clock = Clock.systemDefaultZone();\n } else if(clockOrZone instanceof ZoneId){\n clock = Clock.system(clockOrZone);\n } else {\n clock = clockOrZone;\n }\n return LocalDate.ofInstant(clock.instant(), clock.zone());\n }\n\n /**\n * obtain a LocalDate from an Instant in the specified time-zone or, if null\n * in the system default time-zone\n *\n * @param {!Instant} instant\n * @param {ZoneId} [zone=ZoneId.systemDefault()], defaults to ZoneId.systemDefault()\n * @returns {LocalDate} the current date, not null\n */\n static ofInstant(instant, zone=ZoneId.systemDefault()){\n requireNonNull(instant, 'instant');\n const offset = zone.rules().offset(instant);\n const epochSec = instant.epochSecond() + offset.totalSeconds();\n const epochDay = MathUtil.floorDiv(epochSec, LocalTime.SECONDS_PER_DAY);\n return LocalDate.ofEpochDay(epochDay);\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a year, month and day.\n *\n * This returns a {@link LocalDate} with the specified year, month and day-of-month.\n * The day must be valid for the year and month, otherwise an exception will be thrown.\n *\n * @param {!number} year - the year to represent, from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @param {!(Month|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 * @return {LocalDate} the local date, not null\n * @throws {DateTimeException} if the value of any field is out of range,\n * or if the day-of-month is invalid for the month-year\n */\n static of(year, month, dayOfMonth) {\n return new LocalDate(year, month, dayOfMonth);\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a year and day-of-year.\n *\n * This returns a {@link LocalDate} with the specified year and day-of-year.\n * The day-of-year must be valid for the year, otherwise an exception will be thrown.\n *\n * @param {!number} year - the year to represent, from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @param {!number} dayOfYear - the day-of-year to represent, from 1 to 366\n * @return {LocalDate} the local date, not null\n * @throws {DateTimeException} if the value of any field is out of range,\n * or if the day-of-year is invalid for the year\n */\n static ofYearDay(year, dayOfYear) {\n ChronoField.YEAR.checkValidValue(year);\n //TODO: ChronoField.DAY_OF_YEAR.checkValidValue(dayOfYear);\n const leap = IsoChronology.isLeapYear(year);\n if (dayOfYear === 366 && leap === false) {\n assert(false, 'Invalid date \\'DayOfYear 366\\' as \\'' + year + '\\' is not a leap year', DateTimeException);\n }\n let moy = Month.of(Math.floor((dayOfYear - 1) / 31 + 1));\n const monthEnd = moy.firstDayOfYear(leap) + moy.length(leap) - 1;\n if (dayOfYear > monthEnd) {\n moy = moy.plus(1);\n }\n const dom = dayOfYear - moy.firstDayOfYear(leap) + 1;\n return new LocalDate(year, moy.value(), dom);\n }\n\n /**\n * Obtains an instance of LocalDate from the epoch day count.\n *\n * This returns a LocalDate with the specified epoch-day.\n * The {@link ChronoField.EPOCH_DAY} is a simple incrementing count\n * of days where day 0 is 1970-01-01. Negative numbers represent earlier days.\n *\n * @param {number} [epochDay=0] - the Epoch Day to convert, based on the epoch 1970-01-01\n * @return {LocalDate} the local date, not null\n * @throws {AssertionError} if the epoch days exceeds the supported date range\n */\n static ofEpochDay(epochDay=0) {\n let adjust, adjustCycles, doyEst, yearEst, zeroDay;\n zeroDay = epochDay + DAYS_0000_TO_1970;\n zeroDay -= 60;\n adjust = 0;\n if (zeroDay < 0) {\n adjustCycles = MathUtil.intDiv(zeroDay + 1, DAYS_PER_CYCLE) - 1;\n adjust = adjustCycles * 400;\n zeroDay += -adjustCycles * DAYS_PER_CYCLE;\n }\n yearEst = MathUtil.intDiv(400 * zeroDay + 591, DAYS_PER_CYCLE);\n doyEst = zeroDay - (365 * yearEst + MathUtil.intDiv(yearEst, 4) - MathUtil.intDiv(yearEst, 100) + MathUtil.intDiv(yearEst, 400));\n if (doyEst < 0) {\n yearEst--;\n doyEst = zeroDay - (365 * yearEst + MathUtil.intDiv(yearEst, 4) - MathUtil.intDiv(yearEst, 100) + MathUtil.intDiv(yearEst, 400));\n }\n yearEst += adjust;\n const marchDoy0 = doyEst;\n const marchMonth0 = MathUtil.intDiv(marchDoy0 * 5 + 2, 153);\n const month = (marchMonth0 + 2) % 12 + 1;\n const dom = marchDoy0 - MathUtil.intDiv(marchMonth0 * 306 + 5, 10) + 1;\n yearEst += MathUtil.intDiv(marchMonth0, 10);\n const year = yearEst;\n return new LocalDate(year, month, dom);\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link LocalDate}.\n *\n * The conversion uses the {@link TemporalQueries.localDate} query, which relies\n * on extracting the {@link ChronoField.EPOCH_DAY} field.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link LocalDate::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {LocalDate} the local date, not null\n * @throws {DateTimeException} if unable to convert to a {@link LocalDate}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n const date = temporal.query(TemporalQueries.localDate());\n if (date == null) {\n throw new DateTimeException(\n `Unable to obtain LocalDate from TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n return date;\n }\n\n /**\n * Obtains an instance of {@link LocalDate} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a date.\n *\n * @param {!string} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=DateTimeFormatter.ISO_LOCAL_DATE] - the formatter to use, default is\n * {@link DateTimeFormatter.ISO_LOCAL_DATE}\n * @return {LocalDate} the parsed local date, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter = DateTimeFormatter.ISO_LOCAL_DATE){\n assert(formatter != null, 'formatter', NullPointerException);\n return formatter.parse(text, LocalDate.FROM);\n }\n\n /**\n * Resolves the date, resolving days past the end of month.\n *\n * @param {!number} year - the year to represent, validated from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @param {!number} month - the month-of-year to represent, validated from 1 to 12\n * @param {!number} day - the day-of-month to represent, validated from 1 to 31\n * @return {LocalDate} resolved date, not null\n */\n static _resolvePreviousValid(year, month, day) {\n switch (month) {\n case 2:\n day = Math.min(day, IsoChronology.isLeapYear(year) ? 29 : 28);\n break;\n case 4:\n case 6:\n case 9:\n case 11:\n day = Math.min(day, 30);\n break;\n }\n return LocalDate.of(year, month, day);\n }\n\n /**\n * Do not call the constructor directly, use the of*() factories instead like {@link LocalDate.of}\n *\n * @param {!number} year\n * @param {!(Month|number)} month\n * @param {!number} dayOfMonth\n * @private\n */\n constructor(year, month, dayOfMonth){\n super();\n if (month instanceof Month) {\n month = month.value();\n }\n this._year = MathUtil.safeToInt(year);\n this._month = MathUtil.safeToInt(month);\n this._day = MathUtil.safeToInt(dayOfMonth);\n LocalDate._validate(this._year, this._month, this._day);\n }\n\n\n /**\n *\n * @param {!number} year\n * @param {!number} month\n * @param {!number} dayOfMonth\n * @throws {DateTimeException} if date values are invalid\n * @private\n */\n static _validate(year, month, dayOfMonth) {\n let dom;\n ChronoField.YEAR.checkValidValue(year);\n ChronoField.MONTH_OF_YEAR.checkValidValue(month);\n ChronoField.DAY_OF_MONTH.checkValidValue(dayOfMonth);\n\n if (dayOfMonth > 28) {\n dom = 31;\n switch (month) {\n case 2:\n dom = IsoChronology.isLeapYear(year) ? 29 : 28;\n break;\n case 4:\n case 6:\n case 9:\n case 11:\n dom = 30;\n }\n if (dayOfMonth > dom) {\n if (dayOfMonth === 29) {\n assert(false, 'Invalid date \\'February 29\\' as \\'' + year + '\\' is not a leap year', DateTimeException);\n } else {\n assert(false, 'Invalid date \\'' + year + '\\' \\'' + month + '\\' \\'' + dayOfMonth + '\\'', DateTimeException);\n }\n }\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 LocalDate.range} range and\n * {@link LocalDate.get} get methods will throw an exception.\n *\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link LocalDate.isSupported} supported fields will return valid\n * values based on this date-time.\n * The supported fields are:\n *\n * * {@link ChronoField.DAY_OF_WEEK}\n * * {@link ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH}\n * * {@link ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR}\n * * {@link ChronoField.DAY_OF_MONTH}\n * * {@link ChronoField.DAY_OF_YEAR}\n * * {@link ChronoField.EPOCH_DAY}\n * * {@link ChronoField.ALIGNED_WEEK_OF_MONTH}\n * * {@link ChronoField.ALIGNED_WEEK_OF_YEAR}\n * * {@link ChronoField.MONTH_OF_YEAR}\n * * {@link ChronoField.EPOCH_MONTH}\n * * {@link ChronoField.YEAR_OF_ERA}\n * * {@link ChronoField.YEAR}\n * * {@link ChronoField.ERA}\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 date, false if not\n */\n isSupported(field) {\n return super.isSupported(field);\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 LocalDate.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 */\n range(field) {\n if (field instanceof ChronoField) {\n if (field.isDateBased()) {\n switch (field) {\n case ChronoField.DAY_OF_MONTH: return ValueRange.of(1, this.lengthOfMonth());\n case ChronoField.DAY_OF_YEAR: return ValueRange.of(1, this.lengthOfYear());\n case ChronoField.ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, this.month() === Month.FEBRUARY && this.isLeapYear() === false ? 4 : 5);\n case 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 field.range();\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + 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 LocalDate.isSupported} supported fields will return valid\n * values based on this date, except {@link ChronoField.EPOCH_DAY} and {@link ChronoField.EPOCH_MONTH}\n * which are too large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 the value for the field\n * @throws {DateTimeException} if a value for the field cannot be obtained\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * see {LocalDate.get}, get and getLong are identical in javascript, because we are only limited by\n * {@link MathUtil.MIN_SAFE_INTEGER}/ {@link MathUtil.MAX_SAFE_INTEGER}\n *\n * @param {!TemporalField} field\n * @returns {*}\n */\n getLong(field) {\n assert(field != null, '', NullPointerException);\n if (field instanceof ChronoField) {\n return this._get0(field);\n }\n return field.getFrom(this);\n }\n\n /**\n * TODO tests are missing for the ALIGNED_* ChronoFields\n *\n * @param {!TemporalField} field\n * @returns {*}\n * @private\n */\n _get0(field) {\n switch (field) {\n case ChronoField.DAY_OF_WEEK: return this.dayOfWeek().value();\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH: return MathUtil.intMod((this._day - 1), 7) + 1;\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR: return MathUtil.intMod((this.dayOfYear() - 1), 7) + 1;\n case ChronoField.DAY_OF_MONTH: return this._day;\n case ChronoField.DAY_OF_YEAR: return this.dayOfYear();\n case ChronoField.EPOCH_DAY: return this.toEpochDay();\n case ChronoField.ALIGNED_WEEK_OF_MONTH: return MathUtil.intDiv((this._day - 1), 7) + 1;\n case ChronoField.ALIGNED_WEEK_OF_YEAR: return MathUtil.intDiv((this.dayOfYear() - 1), 7) + 1;\n case ChronoField.MONTH_OF_YEAR: return this._month;\n case ChronoField.PROLEPTIC_MONTH: return this._prolepticMonth();\n case ChronoField.YEAR_OF_ERA: return (this._year >= 1 ? this._year : 1 - this._year);\n case ChronoField.YEAR: return this._year;\n case ChronoField.ERA: return (this._year >= 1 ? 1 : 0);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n\n /**\n *\n * @return {number}\n * @private\n */\n _prolepticMonth() {\n return (this._year * 12) + (this._month - 1);\n }\n\n /**\n * Gets the chronology of this date, which is the ISO calendar system.\n *\n * The {@link Chronology} represents the calendar system in use.\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 todays's rules for leap years are applied for all time.\n *\n * @return {Chronology} the ISO chronology, not null\n */\n chronology() {\n return IsoChronology.INSTANCE;\n }\n\n /**\n *\n * @return {number} gets the year\n */\n year() {\n return this._year;\n }\n\n /**\n *\n * @return {number} gets the month value\n */\n monthValue() {\n return this._month;\n }\n\n /**\n *\n * @returns {Month} month\n */\n month() {\n return Month.of(this._month);\n }\n\n /**\n *\n * @return {number} gets the day of month\n */\n dayOfMonth() {\n return this._day;\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.month().firstDayOfYear(this.isLeapYear()) + this._day - 1;\n }\n\n /**\n * Gets the day-of-week field, which is an enum {@link 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 {@link DayOfWeek}.\n * This includes textual names of the values.\n *\n * @return {DayOfWeek} the day-of-week, not null\n */\n dayOfWeek() {\n const dow0 = MathUtil.floorMod(this.toEpochDay() + 3, 7);\n return DayOfWeek.of(dow0 + 1);\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 * Returns the length of the month represented by this date.\n *\n * This returns the length of the month in days.\n * For example, a date in January would return 31.\n *\n * @return {number} the length of the month in days\n */\n lengthOfMonth() {\n switch (this._month) {\n case 2:\n return (this.isLeapYear() ? 29 : 28);\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n default:\n return 31;\n }\n }\n\n /**\n * Returns the length of the year represented by this date.\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 * function overloading for the {@link LocalDate.with} method.\n *\n * calling \"with\" with one (or less) argument, assumes that the argument is an TemporalAdjuster\n * and {@link LocalDate.withTemporalAdjuster} is called.\n *\n * Otherwise a TemporalField and newValue argument is expected and\n * {@link LocalDate.withFieldAndValue} is called.\n *\n * @param {!(TemporalAdjuster|TemporalField)} fieldOrAdjuster\n * @param {number} newValue - required if first argument is a TemporalField\n * @return {LocalDate} the new LocalDate with the newValue set.\n */\n with(fieldOrAdjuster, newValue){\n if(arguments.length < 2){\n return this.withTemporalAdjuster(fieldOrAdjuster);\n } else {\n return this.withFieldAndValue(fieldOrAdjuster, newValue);\n }\n }\n\n /**\n * Returns an adjusted copy of this date.\n *\n * This returns a new {@link LocalDate}, 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 {@link 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 *
\n * import static org.threeten.bp.Month.*;\n * import static org.threeten.bp.temporal.Adjusters.*;\n *\n * result = localDate.with(JULY).with(lastDayOfMonth());\n *\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 * @param {!TemporalAdjuster} adjuster - the adjuster to use, not null\n * @return {LocalDate} a {@link LocalDate} 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 withTemporalAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalDate) {\n return adjuster;\n }\n assert(typeof adjuster.adjustInto === 'function', 'adjuster', IllegalArgumentException);\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this date with the specified field set to a new value.\n *\n * This returns a new {@link LocalDate}, 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 * The supported fields behave as follows:\n *\n * * {@link DAY_OF_WEEK} -\n * Returns a {@link LocalDate} with the specified day-of-week.\n * The date is adjusted up to 6 days forward or backward within the boundary\n * of a Monday to Sunday week.\n * * {@link ALIGNED_DAY_OF_WEEK_IN_MONTH} -\n * Returns a {@link LocalDate} with the specified aligned-day-of-week.\n * The date is adjusted to the specified month-based aligned-day-of-week.\n * Aligned weeks are counted such that the first week of a given month starts\n * on the first day of that month.\n * This may cause the date to be moved up to 6 days into the following month.\n * * {@link ALIGNED_DAY_OF_WEEK_IN_YEAR} -\n * Returns a {@link LocalDate} with the specified aligned-day-of-week.\n * The date is adjusted to the specified year-based aligned-day-of-week.\n * Aligned weeks are counted such that the first week of a given year starts\n * on the first day of that year.\n * This may cause the date to be moved up to 6 days into the following year.\n * * {@link DAY_OF_MONTH} -\n * Returns a {@link LocalDate} with the specified day-of-month.\n * The month and year will be unchanged. If the day-of-month is invalid for the\n * year and month, then a {@link DateTimeException} is thrown.\n * * {@link DAY_OF_YEAR} -\n * Returns a {@link LocalDate} with the specified day-of-year.\n * The year will be unchanged. If the day-of-year is invalid for the\n * year, then a {@link DateTimeException} is thrown.\n * * {@link EPOCH_DAY} -\n * Returns a {@link LocalDate} with the specified epoch-day.\n * This completely replaces the date and is equivalent to {@link ofEpochDay}.\n * * {@link ALIGNED_WEEK_OF_MONTH} -\n * Returns a {@link LocalDate} with the specified aligned-week-of-month.\n * Aligned weeks are counted such that the first week of a given month starts\n * on the first day of that month.\n * This adjustment moves the date in whole week chunks to match the specified week.\n * The result will have the same day-of-week as this date.\n * This may cause the date to be moved into the following month.\n * * {@link ALIGNED_WEEK_OF_YEAR} -\n * Returns a {@link LocalDate} with the specified aligned-week-of-year.\n * Aligned weeks are counted such that the first week of a given year starts\n * on the first day of that year.\n * This adjustment moves the date in whole week chunks to match the specified week.\n * The result will have the same day-of-week as this date.\n * This may cause the date to be moved into the following year.\n * * {@link MONTH_OF_YEAR} -\n * Returns a {@link LocalDate} with the specified month-of-year.\n * The year will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n * * {@link PROLEPTIC_MONTH} -\n * Returns a {@link LocalDate} with the specified proleptic-month.\n * The day-of-month will be unchanged, unless it would be invalid for the new month\n * and year. In that case, the day-of-month is adjusted to the maximum valid value\n * for the new month and year.\n * * {@link YEAR_OF_ERA} -\n * Returns a {@link LocalDate} with the specified year-of-era.\n * The era and month will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n * * {@link YEAR} -\n * Returns a {@link LocalDate} with the specified year.\n * The month will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n * * {@link ERA} -\n * Returns a {@link LocalDate} with the specified era.\n * The year-of-era and month will be unchanged. The day-of-month will also be unchanged,\n * unless it would be invalid for the new month and year. In that case, the\n * day-of-month is adjusted to the maximum valid value for the new month and year.\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 * @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 {LocalDate} a {@link LocalDate} based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n withFieldAndValue(field, newValue) {\n assert(field != null, 'field', NullPointerException);\n if (field instanceof ChronoField) {\n const f = field;\n f.checkValidValue(newValue);\n switch (f) {\n case ChronoField.DAY_OF_WEEK: return this.plusDays(newValue - this.dayOfWeek().value());\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH: return this.plusDays(newValue - this.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH));\n case ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR: return this.plusDays(newValue - this.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR));\n case ChronoField.DAY_OF_MONTH: return this.withDayOfMonth(newValue);\n case ChronoField.DAY_OF_YEAR: return this.withDayOfYear(newValue);\n case ChronoField.EPOCH_DAY: return LocalDate.ofEpochDay(newValue);\n case ChronoField.ALIGNED_WEEK_OF_MONTH: return this.plusWeeks(newValue - this.getLong(ChronoField.ALIGNED_WEEK_OF_MONTH));\n case ChronoField.ALIGNED_WEEK_OF_YEAR: return this.plusWeeks(newValue - this.getLong(ChronoField.ALIGNED_WEEK_OF_YEAR));\n case ChronoField.MONTH_OF_YEAR: return this.withMonth(newValue);\n case ChronoField.PROLEPTIC_MONTH: return this.plusMonths(newValue - this.getLong(ChronoField.PROLEPTIC_MONTH));\n case ChronoField.YEAR_OF_ERA: return this.withYear((this._year >= 1 ? newValue : 1 - newValue));\n case ChronoField.YEAR: return this.withYear(newValue);\n case ChronoField.ERA: return (this.getLong(ChronoField.ERA) === newValue ? this : this.withYear(1 - this._year));\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n /**\n * Returns a copy of this date with the year altered.\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 * @param {!number} year the year to set in the result, from {@link Year.MIN_VALUE} to {@link Year.MAX_VALUE}\n * @return {LocalDate} a {@link LocalDate} based on this date with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n if (this._year === year) {\n return this;\n }\n ChronoField.YEAR.checkValidValue(year);\n return LocalDate._resolvePreviousValid(year, this._month, this._day);\n }\n\n /**\n * Returns a copy of this date with the month-of-year altered.\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 * @param {!(Month|number)} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {LocalDate} a {@link LocalDate} 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 const m = (month instanceof Month) ? month.value() : month;\n if (this._month === m) {\n return this;\n }\n ChronoField.MONTH_OF_YEAR.checkValidValue(m);\n return LocalDate._resolvePreviousValid(this._year, m, this._day);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the day-of-month altered.\n *\n * If the resulting date is invalid, an exception is thrown.\n *\n * @param {!number} dayOfMonth - the day-of-month to set in the result, from 1 to 28-31\n * @return {LocalDate} 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 if (this._day === dayOfMonth) {\n return this;\n }\n return LocalDate.of(this._year, this._month, dayOfMonth);\n }\n\n /**\n * Returns a copy of this date with the day-of-year altered.\n * If the resulting date is invalid, an exception is thrown.\n *\n * @param dayOfYear the day-of-year to set in the result, from 1 to 365-366\n * @return {LocalDate} a {@link LocalDate} based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-year value is invalid\n * @throws {DateTimeException} if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n if (this.dayOfYear() === dayOfYear) {\n return this;\n }\n return LocalDate.ofYearDay(this._year, dayOfYear);\n }\n\n /**\n * function overloading for plus\n *\n * called with 1 (or less) arguments, p1 is expected to be a TemporalAmount and {@link LocalDate.plus1}\n * is called.\n *\n * Otherwise {@link LocalDate.plus2} is called.\n *\n * @param {!(TemporalAmount|number)} p1\n * @param {TemporalUnit} p2 - required if called with 2 arguments\n * @return {LocalDate}\n */\n plus(p1, p2){\n if(arguments.length < 2){\n return this.plus1(p1);\n } else {\n return this.plus2(p1, p2);\n }\n }\n\n /**\n * Returns a copy of this date with the specified period added.\n *\n * This method returns a new date based on this date with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link LocalDate.plus2}.\n *\n * @param {!TemporalAmount} amount - the amount to add, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the addition made, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n plus1(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this date with the specified period added.\n *\n * This method returns a new date based on this date with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\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 period to add, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the specified period added, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n plus2(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.DAYS: return this.plusDays(amountToAdd);\n case ChronoUnit.WEEKS: return this.plusWeeks(amountToAdd);\n case ChronoUnit.MONTHS: return this.plusMonths(amountToAdd);\n case ChronoUnit.YEARS: return this.plusYears(amountToAdd);\n case ChronoUnit.DECADES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 10));\n case ChronoUnit.CENTURIES: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 100));\n case ChronoUnit.MILLENNIA: return this.plusYears(MathUtil.safeMultiply(amountToAdd, 1000));\n case ChronoUnit.ERAS: return this.with(ChronoField.ERA, MathUtil.safeAdd(this.getLong(ChronoField.ERA), amountToAdd));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in years added.\n *\n * This method adds the specified amount to the years field in three steps:\n *\n * 1. Add the input years to the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) plus one year would result in the\n * invalid date 2009-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2009-02-28, is selected instead.\n *\n * @param {!number} yearsToAdd - the years to add, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported date 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 LocalDate._resolvePreviousValid(newYear, this._month, this._day);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in months added.\n *\n * This method adds the specified amount to the months field in three steps:\n *\n * 1. Add the input months to the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 plus one month would result in the invalid date\n * 2007-04-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-04-30, is selected instead.\n *\n * @param {number} monthsToAdd - the months to add, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the months added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMonths(monthsToAdd) {\n if (monthsToAdd === 0) {\n return this;\n }\n const monthCount = this._year * 12 + (this._month - 1);\n const calcMonths = monthCount + monthsToAdd; // safe overflow\n const newYear = ChronoField.YEAR.checkValidIntValue(MathUtil.floorDiv(calcMonths, 12));\n const newMonth = MathUtil.floorMod(calcMonths, 12) + 1;\n return LocalDate._resolvePreviousValid(newYear, newMonth, this._day);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in weeks added.\n *\n * This method adds the specified amount in weeks to the days field incrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one week would result in 2009-01-07.\n *\n * @param {!number} weeksToAdd - the weeks to add, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the weeks added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusWeeks(weeksToAdd) {\n return this.plusDays(MathUtil.safeMultiply(weeksToAdd, 7));\n }\n\n\n /**\n * Returns a copy of this LocalDate with the specified number of days added.\n *\n * This method adds the specified amount to the days field incrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one day would result in 2009-01-01.\n *\n * @param {number} daysToAdd - the days to add, may be negative\n * @return {LocalDate} a LocalDate based on this date with the days added, not null\n * @throws AssertionError if the result exceeds the supported date range\n */\n plusDays(daysToAdd) {\n if (daysToAdd === 0) {\n return this;\n }\n const mjDay = MathUtil.safeAdd(this.toEpochDay(), daysToAdd);\n return LocalDate.ofEpochDay(mjDay);\n }\n\n /**\n * function overloading for minus\n *\n * called with 1 (or less) arguments, p1 is expected to be a TemporalAmount and {@link LocalDate.minus1}\n * is called.\n *\n * Otherwise {@link LocalDate.minus2} is called.\n *\n * @param {!(TemporalAmount|number)} p1\n * @param {TemporalUnit} p2 - required if called with 2 arguments\n * @return {LocalDate}\n */\n minus(p1, p2){\n if(arguments.length < 2){\n return this.minus1(p1);\n } else {\n return this.minus2(p1, p2);\n }\n }\n\n /**\n * Returns a copy of this date with the specified period subtracted.\n *\n * This method returns a new date based on this date with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * @param {!TemporalAmount} amount - the amount to subtract, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the subtraction made, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n minus1(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this date with the specified period subtracted.\n *\n * This method returns a new date based on this date with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\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 period to subtract, not null\n * @return {LocalDate} a {@link LocalDate} based on this date with the specified period subtracted, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n minus2(amountToSubtract, unit) {\n requireNonNull(amountToSubtract, 'amountToSubtract');\n requireNonNull(unit, 'unit');\n return this.plus2(-1 * amountToSubtract, unit);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in years subtracted.\n *\n * This method subtracts the specified amount from the years field in three steps:\n *\n * 1. Subtract the input years to the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) minus one year would result in the\n * invalid date 2007-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2007-02-28, is selected instead.\n *\n * @param {!number} yearsToSubtract - the years to subtract, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusYears(yearsToSubtract) {\n return this.plusYears(yearsToSubtract * -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in months subtracted.\n *\n * This method subtracts the specified amount from the months field in three steps:\n *\n * 1. Subtract the input months to the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 minus one month would result in the invalid date\n * 2007-02-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-02-28, is selected instead.\n *\n * @param {!number} monthsToSubtract - the months to subtract, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the months subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMonths(monthsToSubtract) {\n return this.plusMonths(monthsToSubtract * -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDate} with the specified period in weeks subtracted.\n *\n * This method subtracts the specified amount in weeks from the days field decrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-07 minus one week would result in 2008-12-31.\n *\n * @param {!number} weeksToSubtract - the weeks to subtract, may be negative\n * @return {LocalDate} a {@link LocalDate} based on this date with the weeks subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusWeeks(weeksToSubtract) {\n return this.plusWeeks(weeksToSubtract * -1);\n }\n\n /*\n * Returns a copy of this LocalDate with the specified number of days subtracted.\n *\n * This method subtracts the specified amount from the days field decrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-01 minus one day would result in 2008-12-31.\n *\n * @param {number} daysToSubtract - the days to subtract, may be negative\n * @return {LocalDate} a LocalDate based on this date with the days subtracted, not null\n * @throws AssertionError if the result exceeds the supported date range\n */\n minusDays(daysToSubtract) {\n return this.plusDays(daysToSubtract * -1);\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 {@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 if (query === TemporalQueries.localDate()) {\n return this;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have the same date as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the date changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * passing {@link ChronoField.EPOCH_DAY} as the field.\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 = thisLocalDate.adjustInto(temporal);\n * temporal = temporal.with(thisLocalDate);\n *\n *\n * @param {!TemporalAdjuster} temporal - the target object to be adjusted, not null\n * @return 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 super.adjustInto(temporal);\n }\n\n /**\n * function overloading for {@link LocalDate.until}\n *\n * called with 1 (or less) arguments {{@link LocalDate.until1}} is called\n * otherwise {@link LocalDate.until2}\n *\n * @param {!TemporalAccessor} p1\n * @param {TemporalUnit} p2 - not null if called with 2 arguments\n * @return {number|Period}\n */\n until(p1, p2){\n if(arguments.length < 2){\n return this.until1(p1);\n } else {\n return this.until2(p1, p2);\n }\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 * The {@link Temporal} passed to this method must be a {@link LocalDate}.\n * For example, the period in days between two dates can be calculated\n * using {@link startDate.until}.\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-15 and 2012-08-14\n * will only be one month as it is one day short of two months.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n * long period = start.until(end, MONTHS); // this method\n * dateTime.plus(MONTHS.between(start, end)); // use in plus/minus\n *\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link DAYS}, {@link WEEKS}, {@link MONTHS}, {@link YEARS},\n * {@link DECADES}, {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS}\n * are supported. 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 input temporal as\n * the second argument.\n *\n * @param {!TemporalAccessor} endExclusive - the end date, which is converted to a {@link LocalDate}, not null\n * @param {!TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this date and the end date\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until2(endExclusive, unit) {\n const end = LocalDate.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.DAYS: return this.daysUntil(end);\n case ChronoUnit.WEEKS: return MathUtil.intDiv(this.daysUntil(end), 7);\n case ChronoUnit.MONTHS: return this._monthsUntil(end);\n case ChronoUnit.YEARS: return MathUtil.intDiv(this._monthsUntil(end), 12);\n case ChronoUnit.DECADES: return MathUtil.intDiv(this._monthsUntil(end), 120);\n case ChronoUnit.CENTURIES: return MathUtil.intDiv(this._monthsUntil(end), 1200);\n case ChronoUnit.MILLENNIA: return MathUtil.intDiv(this._monthsUntil(end), 12000);\n case ChronoUnit.ERAS: return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n /**\n *\n * @param {!LocalDate} end\n * @returns {number}\n * @protected\n */\n daysUntil(end) {\n return end.toEpochDay() - this.toEpochDay(); // no overflow\n }\n\n /**\n *\n * @param {!LocalDate} end\n * @returns {number}\n * @private\n */\n _monthsUntil(end) {\n const packed1 = this._prolepticMonth() * 32 + this.dayOfMonth(); // no overflow\n const packed2 = end._prolepticMonth() * 32 + end.dayOfMonth(); // no overflow\n return MathUtil.intDiv((packed2 - packed1), 32);\n }\n\n /**\n * Calculates the period between this date and another date as a {@link Period}.\n *\n * This calculates the period between two dates in terms of years, months and days.\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 *\n * The calculation is performed using the ISO calendar system.\n * If necessary, the input date will be converted to ISO.\n *\n * The start date is included, but the end date is not.\n * The period is calculated by removing complete months, then calculating\n * the remaining number of days, adjusting to ensure that both have the same sign.\n * The number of months is then normalized into years and months based on a 12 month year.\n * A month is considered to be complete if the end day-of-month is greater\n * than or equal to the start day-of-month.\n * For example, from `2010-01-15` to `2011-03-18` is \"1 year, 2 months and 3 days\".\n *\n * The result of this method can be a negative period if the end is before the start.\n * The negative sign will be the same in each of year, month and day.\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 Period#between}:\n *
\n * // these two lines are equivalent\n * period = start.until(end);\n * period = Period.between(start, end);\n *\n * The choice should be made based on which makes the code more readable.\n *\n * @param {!TemporalAccessor} endDate - the end date, exclusive, which may be in any chronology, not null\n * @return {Period} the period between this date and the end date, not null\n */\n until1(endDate) {\n const end = LocalDate.from(endDate);\n let totalMonths = end._prolepticMonth() - this._prolepticMonth(); // safe\n let days = end._day - this._day;\n if (totalMonths > 0 && days < 0) {\n totalMonths--;\n const calcDate = this.plusMonths(totalMonths);\n days = (end.toEpochDay() - calcDate.toEpochDay()); // safe\n } else if (totalMonths < 0 && days > 0) {\n totalMonths++;\n days -= end.lengthOfMonth();\n }\n const years = MathUtil.intDiv(totalMonths, 12); // safe\n const months = MathUtil.intMod(totalMonths, 12); // safe\n return Period.of(years, months, days);\n }\n\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link LocalDate.atTime}\n *\n * if called with 1 argument {@link LocalDate.atTime1} is called\n * otherwise {@link LocalDate.atTime4}\n *\n * @return {LocalDateTime} the local date-time formed from this date and the specified params\n */\n atTime(){\n if(arguments.length===1){\n return this.atTime1.apply(this, arguments);\n } else {\n return this.atTime4.apply(this, arguments);\n }\n }\n\n /**\n * Combines this date with a time to create a {@link LocalDateTime}.\n *\n * This returns a {@link LocalDateTime} formed from this date at the specified time.\n * All possible combinations of date and time are valid.\n *\n * @param {LocalTime} time - the time to combine with, not null\n * @return {LocalDateTime} the local date-time formed from this date and the specified time, not null\n */\n atTime1(time) {\n return LocalDateTime.of(this, time);\n }\n\n /**\n * Combines this date with a time to create a {@link LocalDateTime}.\n *\n * This returns a {@link LocalDateTime} formed from this date at the\n * specified hour, minute, second and nanosecond.\n * The individual time fields must be within their valid range.\n * All possible combinations of date and time are valid.\n *\n * @param {!number} hour - the hour-of-day to use, from 0 to 23\n * @param {!number} minute - the minute-of-hour to use, from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, from 0 to 999,999,999\n * @return {LocalDateTime} the local date-time formed from this date and the specified time, not null\n * @throws {DateTimeException} if the value of any field is out of range\n */\n atTime4(hour, minute, second=0, nanoOfSecond=0) {\n return this.atTime1(LocalTime.of(hour, minute, second, nanoOfSecond));\n }\n\n /**\n * Combines this date with an offset time to create an {@link OffsetDateTime}.\n *\n * This returns an {@link OffsetDateTime} formed from this date at the specified time.\n * All possible combinations of date and time are valid.\n *\n * @param {OffsetTime} 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 /*\n _atTimeOffsetTime(time) { // atTime(offsetTime)\n return OffsetDateTime.of(LocalDateTime.of(this, time.toLocalTime()), time.getOffset());\n }\n*/\n\n /**\n * Combines this date with the time of midnight to create a {@link LocalDateTime}\n * at the start of this date.\n *\n * This returns a {@link LocalDateTime} formed from this date at the time of\n * midnight, 00:00, at the start of this date.\n *\n * @param {ZoneId} zone - if zone is not null @see {@link LocalDate.atStartOfDayWithZone}\n * @return {LocalDateTime|ZonedDateTime} the local date-time of midnight at the start of this date, not null\n */\n atStartOfDay(zone) {\n if(zone != null){\n return this.atStartOfDayWithZone(zone);\n } else {\n return LocalDateTime.of(this, LocalTime.MIDNIGHT);\n }\n }\n\n /**\n * Combines this date with a time-zone to create a {@link ZonedDateTime}\n * at the start of the day\n *\n * This returns a {@link ZonedDateTime} formed from this date at the\n * specified zone, with the time set to be the earliest valid time according\n * to the rules in the time-zone.\n *\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may not be midnight.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, there are two valid offsets, and the earlier one is used,\n * corresponding to the first occurrence of midnight on the date.\n * In the case of a gap, the zoned date-time will represent the instant just after the gap.\n *\n * If the zone ID is a {@link ZoneOffset}, then the result always has a time of midnight.\n *\n * To convert to a specific time in a given time-zone call {@link atTime}\n * followed by {@link LocalDateTime#atZone}.\n *\n * @param {!ZoneId} zone - the zone ID to use, not null\n * @return {ZonedDateTime} the zoned date-time formed from this date and the earliest valid time for the zone, not null\n */\n atStartOfDayWithZone(zone) {\n requireNonNull(zone, 'zone');\n let ldt = this.atTime(LocalTime.MIDNIGHT);\n // need to handle case where there is a gap from 11:30 to 00:30\n // standard ZDT factory would result in 01:00 rather than 00:30\n if (zone instanceof ZoneOffset === false) {\n const trans = zone.rules().transition(ldt);\n if (trans != null && trans.isGap()) {\n ldt = trans.dateTimeAfter();\n }\n }\n return ZonedDateTime.of(ldt, zone);\n }\n\n\n /**\n * Converts this date to the Epoch Day.\n *\n * The Epoch Day count is a simple incrementing count of days where day 0 is 1970-01-01 (ISO).\n * This definition is the same for all chronologies, enabling conversion.\n *\n * @return {number} the Epoch Day equivalent to this date\n */\n toEpochDay() {\n const y = this._year;\n const m = this._month;\n let total = 0;\n total += 365 * y;\n if (y >= 0) {\n total += MathUtil.intDiv(y + 3, 4) - MathUtil.intDiv(y + 99, 100) + MathUtil.intDiv(y + 399, 400);\n } else {\n total -= MathUtil.intDiv(y, -4) - MathUtil.intDiv(y, -100) + MathUtil.intDiv(y, -400);\n }\n total += MathUtil.intDiv(367 * m - 362, 12);\n total += this.dayOfMonth() - 1;\n if (m > 2) {\n total--;\n if (!IsoChronology.isLeapYear(y)) {\n total--;\n }\n }\n return total - DAYS_0000_TO_1970;\n }\n\n /**\n * Compares this date to another date.\n *\n * The comparison is primarily based on the date, from earliest to latest.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * If all the dates being compared are instances of {@link LocalDate},\n * then the comparison will be entirely based on the date.\n * If some dates being compared are in different chronologies, then the\n * chronology is also considered, see {@link ChronoLocalDate.compareTo}.\n *\n * @param {!LocalDate} 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, LocalDate, 'other');\n return this._compareTo0(other);\n // return super.compareTo(other); if not instanceof LocalDate\n }\n\n /**\n *\n * @param {!LocalDate} otherDate\n * @returns {number}\n * @private\n */\n _compareTo0(otherDate) {\n let cmp = (this._year - otherDate._year);\n if (cmp === 0) {\n cmp = (this._month - otherDate._month);\n if (cmp === 0) {\n cmp = (this._day - otherDate._day);\n }\n }\n return cmp;\n }\n\n /**\n * Checks if this date is after the specified date.\n *\n * This checks to see if this date represents a point on the\n * local time-line after the other date.\n *
\n * LocalDate a = LocalDate.of(2012, 6, 30);\n * LocalDate b = LocalDate.of(2012, 7, 1);\n * a.isAfter(b) == false\n * a.isAfter(a) == false\n * b.isAfter(a) == true\n *\n *\n * This method only considers the position of the two dates on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_COMPARATOR}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {boolean} true if this date is after the specified date\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n // return super.isAfter(other) if not instanceof LocalDate\n }\n\n /**\n * Checks if this date is before the specified date.\n *\n * This checks to see if this date represents a point on the\n * local time-line before the other date.\n *
\n * LocalDate a = LocalDate.of(2012, 6, 30);\n * LocalDate b = LocalDate.of(2012, 7, 1);\n * a.isBefore(b) == true\n * a.isBefore(a) == false\n * b.isBefore(a) == false\n *\n *\n * This method only considers the position of the two dates on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_COMPARATOR}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {boolean} true if this date is before the specified date\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n // return super.isBefore(other) if not instanceof LocalDate\n }\n\n /**\n * Checks if this date is equal to the specified date.\n *\n * This checks to see if this date represents the same point on the\n * local time-line as the other date.\n *
\n * LocalDate a = LocalDate.of(2012, 6, 30);\n * LocalDate b = LocalDate.of(2012, 7, 1);\n * a.isEqual(b) == false\n * a.isEqual(a) == true\n * b.isEqual(a) == false\n *\n *\n * This method only considers the position of the two dates on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo}\n * but is the same approach as {@link DATE_COMPARATOR}.\n *\n * @param {!LocalDate} other - the other date to compare to, not null\n * @return {boolean} true if this date is equal to the specified date\n */\n isEqual(other) {\n return this.compareTo(other) === 0;\n // return super.isEqual(other) if not instanceof LocalDate\n }\n\n /**\n * Checks if this date is equal to another date.\n *\n * Compares this LocalDate with another ensuring that the date is the same.\n *\n * Only objects of type LocalDate are compared, other types return false.\n *\n * @param {*} otherDate - the object to check, null returns false\n * @return {boolean} true if this is equal to the other date\n */\n equals(otherDate) {\n if (this === otherDate) {\n return true;\n }\n if (otherDate instanceof LocalDate) {\n return this._compareTo0(otherDate) === 0;\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 const yearValue = this._year;\n const monthValue = this._month;\n const dayValue = this._day;\n return MathUtil.hash((yearValue & 0xFFFFF800) ^ ((yearValue << 11) + (monthValue << 6) + (dayValue)));\n }\n\n /**\n * Outputs this date as a String, such as 2007-12-03.\n * The output will be in the ISO-8601 format uuuu-MM-dd.\n *\n * @return {string} a string representation of this date, not null\n */\n toString() {\n let dayString, monthString, yearString;\n\n const yearValue = this._year;\n const monthValue = this._month;\n const dayValue = this._day;\n\n const absYear = Math.abs(yearValue);\n\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\n if (monthValue < 10) {\n monthString = '-0' + monthValue;\n } else {\n monthString = '-' + monthValue;\n }\n\n if (dayValue < 10) {\n dayString = '-0' + dayValue;\n } else {\n dayString = '-' + dayValue;\n }\n\n return yearString + monthString + dayString;\n }\n\n /**\n *\n * @return {string} same as {@link LocalDate.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this date as a string using the formatter.\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 requireInstance(formatter, DateTimeFormatter, 'formatter');\n return super.format(formatter);\n }\n}\n\nexport function _init() {\n /**\n * The minimum supported {@link LocalDate}\n * This could be used by an application as a \"far past\" date.\n */\n LocalDate.MIN = LocalDate.of(YearConstants.MIN_VALUE, 1, 1);\n /**\n * The maximum supported {@link LocalDate}\n * This could be used by an application as a \"far future\" date.\n */\n LocalDate.MAX = LocalDate.of(YearConstants.MAX_VALUE, 12, 31);\n /**\n * The date at epoch day 0, that is 1970-01-01.\n */\n LocalDate.EPOCH_0 = LocalDate.ofEpochDay(0);\n\n LocalDate.FROM = createTemporalQuery('LocalDate.FROM', (temporal) => {\n return LocalDate.from(temporal);\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 {requireNonNull, requireInstance} from '../assert';\nimport {MathUtil} from '../MathUtil';\n\nimport {LocalDate} from '../LocalDate';\nimport {Instant} from '../Instant';\nimport {ZoneOffset} from '../ZoneOffset';\nimport {ChronoUnit} from '../temporal/ChronoUnit';\nimport {ChronoField} from '../temporal/ChronoField';\nimport {Temporal} from '../temporal/Temporal';\nimport {TemporalQueries} from '../temporal/TemporalQueries';\n\n/**\n * A date-time without a time-zone in an arbitrary chronology, intended\n * for advanced globalization use cases.\n *\n * **Most applications should declare method signatures, fields and variables\n * as {@link LocalDateTime}, not this interface.**\n *\n * A {@link ChronoLocalDateTime} is the abstract representation of a local date-time\n * where the {@link Chronology}, or calendar system, is pluggable.\n * The date-time is defined in terms of fields expressed by {@link TemporalField},\n * where most common implementations are defined in {@link ChronoField}.\n * The chronology defines how the calendar system operates and the meaning of\n * the standard fields.\n *\n * #### When to use this interface\n *\n * The design of the API encourages the use of {@link LocalDateTime} rather than this\n * interface, even in the case where the application needs to deal with multiple\n * calendar systems. The rationale for this is explored in detail in {@link ChronoLocalDate}.\n *\n * Ensure that the discussion in {@link ChronoLocalDate} has been read and understood\n * before using this interface.\n *\n * ### Specification for implementors\n *\n * This interface must be implemented with care to ensure other classes operate correctly.\n * All implementations that can be instantiated must be final, immutable and thread-safe.\n * Subclasses should be Serializable wherever possible.\n *\n * In JDK 8, this is an interface with default methods.\n * Since there are no default methods in JDK 7, an abstract class is used.\n *\n * @param D the date type\n */\nexport class ChronoLocalDateTime extends Temporal {\n /*
\n * import static org.threeten.bp.Month.*;\n * import static org.threeten.bp.temporal.Adjusters.*;\n *\n * result = localDateTime.with(JULY).with(lastDayOfMonth());\n *\n *\n * The classes {@link LocalDate} and {@link LocalTime} implement {@link TemporalAdjuster},\n * thus this method can be used to change the date, time or offset:\n *
\n * result = localDateTime.with(date);\n * result = localDateTime.with(time);\n *\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 {LocalDateTime} a {@link LocalDateTime} 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 withTemporalAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalDate) {\n return this._withDateTime(adjuster, this._time);\n } else if (adjuster instanceof LocalTime) {\n return this._withDateTime(this._date, adjuster);\n } else if (adjuster instanceof LocalDateTime) {\n return adjuster;\n }\n assert(typeof adjuster.adjustInto === 'function', 'adjuster', IllegalArgumentException);\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified field set to a new value.\n *\n * This returns a new {@link LocalDateTime}, 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-time 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 * The supported fields (see {@link isSupported}) will behave as in\n * {@link LocalDate#with} or {@link LocalTime#with}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 {LocalDateTime} a {@link LocalDateTime} based on `this` with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n with2(field, newValue) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n if (field.isTimeBased()) {\n return this._withDateTime(this._date, this._time.with(field, newValue));\n } else {\n return this._withDateTime(this._date.with(field, newValue), this._time);\n }\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the year altered.\n * The time 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} year - the year to set in the result, from MIN_YEAR to MAX_YEAR\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested year, not null\n * @throws {DateTimeException} if the year value is invalid\n */\n withYear(year) {\n return this._withDateTime(this._date.withYear(year), this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the month-of-year altered.\n * The time 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)} month - the month-of-year to set in the result, from 1 (January) to 12 (December)\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested month, not null\n * @throws {DateTimeException} if the month-of-year value is invalid\n */\n withMonth(month) {\n return this._withDateTime(this._date.withMonth(month), this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the day-of-month altered.\n * If the resulting {@link LocalDateTime} is invalid, an exception is thrown.\n * The time 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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested day, not null\n * @throws {DateTimeException} if the day-of-month value is invalid\n * @throws {DateTimeException} if the day-of-month is invalid for the month-year\n */\n withDayOfMonth(dayOfMonth) {\n return this._withDateTime(this._date.withDayOfMonth(dayOfMonth), this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the day-of-year altered.\n * If the resulting {@link LocalDateTime} 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 {LocalDateTime} a {@link LocalDateTime} based on this date with the requested day, not null\n * @throws {DateTimeException} if the day-of-year value is invalid\n * @throws {DateTimeException} if the day-of-year is invalid for the year\n */\n withDayOfYear(dayOfYear) {\n return this._withDateTime(this._date.withDayOfYear(dayOfYear), this._time);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the hour-of-day value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hour - the hour-of-day to set in the result, from 0 to 23\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested hour, not null\n * @throws {DateTimeException} if the hour value is invalid\n */\n withHour(hour) {\n const newTime = this._time.withHour(hour);\n return this._withDateTime(this._date, newTime);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the minute-of-hour value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minute - the minute-of-hour to set in the result, from 0 to 59\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested minute, not null\n * @throws {DateTimeException} if the minute value is invalid\n */\n withMinute(minute) {\n const newTime = this._time.withMinute(minute);\n return this._withDateTime(this._date, newTime);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the second-of-minute value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} second - the second-of-minute to set in the result, from 0 to 59\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested second, not null\n * @throws {DateTimeException} if the second value is invalid\n */\n withSecond(second) {\n const newTime = this._time.withSecond(second);\n return this._withDateTime(this._date, newTime);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the nano-of-second value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanoOfSecond - the nano-of-second to set in the result, from 0 to 999,999,999\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the requested nanosecond, not null\n * @throws {DateTimeException} if the nano value is invalid\n */\n withNano(nanoOfSecond) {\n const newTime = this._time.withNano(nanoOfSecond);\n return this._withDateTime(this._date, newTime);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the time truncated.\n *\n * Truncation returns a copy of the original date-time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with {@link ChronoUnit#MINUTES}\n * will set the second-of-minute and nano-of-second field to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS}. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalUnit} unit - the unit to truncate to, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the time truncated, not null\n * @throws {DateTimeException} if unable to truncate\n */\n truncatedTo(unit) {\n return this._withDateTime(this._date, this._time.truncatedTo(unit));\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link LocalDateTime.plus}\n *\n * if called with 1 argument {@link LocalDateTime.plusTemporalAmount} is applied,\n * otherwise {@link LocalDateTime.plus2}\n *\n * @param {!(TemporalAmount|number)} amount\n * @param {TemporalUnit} unit\n * @returns {LocalDateTime}\n */\n plus(amount, unit){\n if(arguments.length === 1){\n return this.plusTemporalAmount(amount);\n } else {\n return this.plus2(amount, unit);\n }\n }\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this time with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to add, not null\n * @return {LocalDateTime} based on this date-time with the addition made, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n plusTemporalAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period added.\n *\n * This method returns a new date-time based on this date-time with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\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 period to add, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the specified period added, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n plus2(amountToAdd, unit) {\n requireNonNull(unit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this.plusDays(MathUtil.intDiv(amountToAdd, LocalTime.MICROS_PER_DAY)).plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MICROS_PER_DAY) * 1000);\n case ChronoUnit.MILLIS: return this.plusDays(MathUtil.intDiv(amountToAdd, LocalTime.MILLIS_PER_DAY)).plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MILLIS_PER_DAY) * 1000000);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n case ChronoUnit.MINUTES: return this.plusMinutes(amountToAdd);\n case ChronoUnit.HOURS: return this.plusHours(amountToAdd);\n case ChronoUnit.HALF_DAYS: return this.plusDays(MathUtil.intDiv(amountToAdd, 256)).plusHours(MathUtil.intMod(amountToAdd, 256) * 12); // no overflow (256 is multiple of 2)\n }\n return this._withDateTime(this._date.plus(amountToAdd, unit), this._time);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in years added.\n *\n * This method adds the specified amount to the years field in three steps:\n *\n * 1. Add the input years to the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) plus one year would result in the\n * invalid date 2009-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2009-02-28, is selected instead.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the years added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusYears(years) {\n const newDate = this._date.plusYears(years);\n return this._withDateTime(newDate, this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in months added.\n *\n * This method adds the specified amount to the months field in three steps:\n *\n * 1. Add the input months to the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 plus one month would result in the invalid date\n * 2007-04-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-04-30, is selected instead.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the months added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMonths(months) {\n const newDate = this._date.plusMonths(months);\n return this._withDateTime(newDate, this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in weeks added.\n *\n * This method adds the specified amount in weeks to the days field incrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one week would result in 2009-01-07.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the weeks added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusWeeks(weeks) {\n const newDate = this._date.plusWeeks(weeks);\n return this._withDateTime(newDate, this._time);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in days added.\n *\n * This method adds the specified amount to the days field incrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2008-12-31 plus one day would result in 2009-01-01.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the days added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusDays(days) {\n const newDate = this._date.plusDays(days);\n return this._withDateTime(newDate, this._time);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in hours added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the hours added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusHours(hours) {\n return this._plusWithOverflow(this._date, hours, 0, 0, 0, 1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in minutes added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the minutes added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusMinutes(minutes) {\n return this._plusWithOverflow(this._date, 0, minutes, 0, 0, 1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in seconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the seconds added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusSeconds(seconds) {\n return this._plusWithOverflow(this._date, 0, 0, seconds, 0, 1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in nanoseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanos - the nanos to add, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the nanoseconds added, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n plusNanos(nanos) {\n return this._plusWithOverflow(this._date, 0, 0, 0, nanos, 1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link LocalDateTime.minus}\n *\n * if called with 1 argument {@link LocalDateTime.minusTemporalAmount} is applied,\n * otherwise {@link LocalDateTime.minus2}\n *\n * @param {!(TemporalAmount|number)} amount\n * @param {TemporalUnit} unit\n * @returns {LocalDateTime}\n */\n minus(amount, unit){\n if(arguments.length === 1){\n return this.minusTemporalAmount(amount);\n } else {\n return this.minus2(amount, unit);\n }\n }\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this time with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {LocalDateTime} based on this date-time with the subtraction made, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n minusTemporalAmount(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this date-time with the specified period subtracted.\n *\n * This method returns a new date-time based on this date-time with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract years, months or days.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\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 period to subtract, not null\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the specified period subtracted, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n minus2(amountToSubtract, unit) {\n requireNonNull(unit, 'unit');\n return this.plus2(-1 * amountToSubtract, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in years subtracted.\n *\n * This method subtracts the specified amount from the years field in three steps:\n *\n * 1. Subtract the input years from the year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2008-02-29 (leap year) minus one year would result in the\n * invalid date 2009-02-29 (standard year). Instead of returning an invalid\n * result, the last valid day of the month, 2009-02-28, is selected instead.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the years subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusYears(years) {\n return this.plusYears(-1 * years);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in months subtracted.\n *\n * This method subtracts the specified amount from the months field in three steps:\n *\n * 1. Subtract the input months from the month-of-year field\n * 2. Check if the resulting date would be invalid\n * 3. Adjust the day-of-month to the last valid day if necessary\n *\n * For example, 2007-03-31 minus one month would result in the invalid date\n * 2007-04-31. Instead of returning an invalid result, the last valid day\n * of the month, 2007-04-30, is selected instead.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the months subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMonths(months) {\n return this.plusMonths(-1 * months);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in weeks subtracted.\n *\n * This method subtracts the specified amount in weeks from the days field decrementing\n * the month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-07 minus one week would result in 2008-12-31.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the weeks subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusWeeks(weeks) {\n return this.plusWeeks(-1 * weeks);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in days subtracted.\n *\n * This method subtracts the specified amount from the days field incrementing the\n * month and year fields as necessary to ensure the result remains valid.\n * The result is only invalid if the maximum/minimum year is exceeded.\n *\n * For example, 2009-01-01 minus one day would result in 2008-12-31.\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 {LocalDateTime} a {@link LocalDateTime} based on this date-time with the days subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusDays(days) {\n return this.plusDays(-1 * days);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in hours subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hours - the hours to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the hours subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusHours(hours) {\n return this._plusWithOverflow(this._date, hours, 0, 0, 0, -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in minutes subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutes - the minutes to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the minutes subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusMinutes(minutes) {\n return this._plusWithOverflow(this._date, 0, minutes, 0, 0, -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in seconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} seconds - the seconds to subtract, may be negative\n * @return {LocalDateTime} a {@link LocalDateTime} based on this date-time with the seconds subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusSeconds(seconds) {\n return this._plusWithOverflow(this._date, 0, 0, seconds, 0, -1);\n }\n\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period in nanoseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Number} nanos - the nanos to subtract, may be negative\n * @return {LocalDateTime} based on this date-time with the nanoseconds subtracted, not null\n * @throws {DateTimeException} if the result exceeds the supported date range\n */\n minusNanos(nanos) {\n return this._plusWithOverflow(this._date, 0, 0, 0, nanos, -1);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalDateTime} with the specified period added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {LocalDate} newDate the new date to base the calculation on, not null\n * @param {Number} hours - the hours to add, may be negative\n * @param {Number} minutes - the minutes to add, may be negative\n * @param {Number} seconds - the seconds to add, may be negative\n * @param {Number} nanos - the nanos to add, may be negative\n * @param {Number} sign - the sign to determine add or subtract\n * @return {LocalDateTime} the combined result, not null\n */\n _plusWithOverflow(newDate, hours, minutes, seconds, nanos, sign) {\n // 9223372036854775808 long, 2147483648 int\n if ((hours | minutes | seconds | nanos) === 0) {\n return this._withDateTime(newDate, this._time);\n }\n let totDays = MathUtil.intDiv(nanos, LocalTime.NANOS_PER_DAY) + // max/24*60*60*1B\n MathUtil.intDiv(seconds, LocalTime.SECONDS_PER_DAY) + // max/24*60*60\n MathUtil.intDiv(minutes, LocalTime.MINUTES_PER_DAY) + // max/24*60\n MathUtil.intDiv(hours, LocalTime.HOURS_PER_DAY); // max/24\n totDays *= sign; // total max*0.4237...\n let totNanos = MathUtil.intMod(nanos, LocalTime.NANOS_PER_DAY) + // max 86400000000000\n (MathUtil.intMod(seconds, LocalTime.SECONDS_PER_DAY)) * LocalTime.NANOS_PER_SECOND + // max 86400000000000\n (MathUtil.intMod(minutes, LocalTime.MINUTES_PER_DAY)) * LocalTime.NANOS_PER_MINUTE + // max 86400000000000\n (MathUtil.intMod(hours, LocalTime.HOURS_PER_DAY)) * LocalTime.NANOS_PER_HOUR; // max 86400000000000\n const curNoD = this._time.toNanoOfDay(); // max 86400000000000\n totNanos = totNanos * sign + curNoD; // total 432000000000000\n totDays += MathUtil.floorDiv(totNanos, LocalTime.NANOS_PER_DAY);\n const newNoD = MathUtil.floorMod(totNanos, LocalTime.NANOS_PER_DAY);\n const newTime = (newNoD === curNoD ? this._time : LocalTime.ofNanoOfDay(newNoD));\n return this._withDateTime(newDate.plusDays(totDays), newTime);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this date-time using the specified query.\n *\n * This queries this date-time 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 if (query === TemporalQueries.localDate()) {\n return this.toLocalDate();\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have the same date and time as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the date and time changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * twice, passing {@link ChronoField#EPOCH_DAY} and\n * {@link ChronoField#NANO_OF_DAY} as the fields.\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 = thisLocalDateTime.adjustInto(temporal);\n * temporal = temporal.with(thisLocalDateTime);\n *\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} temporal - the target object to be adjusted, not null\n * @return {LocalDateTime} 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 super.adjustInto(temporal);\n }\n\n /**\n * Calculates the period between this date-time and another date-time in\n * terms of the specified unit.\n *\n * This calculates the period between two date-times in terms of a single unit.\n * The start and end points are `this` and the specified date-time.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link LocalDateTime}.\n * For example, the period in days between two date-times can be calculated\n * using `startDateTime.until(endDateTime, DAYS)`.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two date-times.\n * For example, the period in months between 2012-06-15T00:00 and 2012-08-14T23:59\n * will only be one month as it is one minute short of two months.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n * long period = start.until(end, MONTHS); // this method\n * dateTime.plus(MONTHS.between(start, end)); // use in plus/minus\n *\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link NANOS}, {@link MICROS}, {@link MILLIS}, {@link SECONDS},\n * {@link MINUTES}, {@link HOURS} and {@link HALF_DAYS}, {@link DAYS},\n * {@link WEEKS}, {@link MONTHS}, {@link YEARS}, {@link DECADES},\n * {@link CENTURIES}, {@link MILLENNIA} and {@link ERAS} are supported.\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 input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date-time, which is converted to a {@link LocalDateTime}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this date-time and the end date-time\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = LocalDateTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n if (unit.isTimeBased()) {\n let daysUntil = this._date.daysUntil(end._date);\n let timeUntil = end._time.toNanoOfDay() - this._time.toNanoOfDay();\n if (daysUntil > 0 && timeUntil < 0) {\n daysUntil--;\n timeUntil += LocalTime.NANOS_PER_DAY;\n } else if (daysUntil < 0 && timeUntil > 0) {\n daysUntil++;\n timeUntil -= LocalTime.NANOS_PER_DAY;\n }\n let amount = daysUntil;\n switch (unit) {\n case ChronoUnit.NANOS:\n amount = MathUtil.safeMultiply(amount, LocalTime.NANOS_PER_DAY);\n return MathUtil.safeAdd(amount, timeUntil);\n case ChronoUnit.MICROS:\n amount = MathUtil.safeMultiply(amount, LocalTime.MICROS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, 1000));\n case ChronoUnit.MILLIS:\n amount = MathUtil.safeMultiply(amount, LocalTime.MILLIS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, 1000000));\n case ChronoUnit.SECONDS:\n amount = MathUtil.safeMultiply(amount, LocalTime.SECONDS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, LocalTime.NANOS_PER_SECOND));\n case ChronoUnit.MINUTES:\n amount = MathUtil.safeMultiply(amount, LocalTime.MINUTES_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, LocalTime.NANOS_PER_MINUTE));\n case ChronoUnit.HOURS:\n amount = MathUtil.safeMultiply(amount, LocalTime.HOURS_PER_DAY);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, LocalTime.NANOS_PER_HOUR));\n case ChronoUnit.HALF_DAYS:\n amount = MathUtil.safeMultiply(amount, 2);\n return MathUtil.safeAdd(amount, MathUtil.intDiv(timeUntil, (LocalTime.NANOS_PER_HOUR * 12)));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n let endDate = end._date;\n const endTime = end._time;\n if (endDate.isAfter(this._date) && endTime.isBefore(this._time)) {\n endDate = endDate.minusDays(1);\n } else if (endDate.isBefore(this._date) && endTime.isAfter(this._time)) {\n endDate = endDate.plusDays(1);\n }\n return this._date.until(endDate, unit);\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this date-time with an offset to create an {@link OffsetDateTime}.\n *\n * This returns an {@link OffsetDateTime} formed from this date-time at the specified offset.\n * All possible combinations of date-time and offset are valid.\n *\n * @param {ZoneOffset} offset the offset to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this date-time and the specified offset, not null\n */\n /*\n atOffset(offset) {\n return OffsetDateTime.of(this, offset);\n }\n*/\n\n /**\n * Combines this date-time with a time-zone to create a {@link ZonedDateTime}.\n *\n * This returns a {@link ZonedDateTime} formed from this date-time at the\n * specified time-zone. The result will match this date-time as closely as possible.\n * Time-zone rules, such as daylight savings, mean that not every local date-time\n * is valid for the specified zone, thus the local date-time may be adjusted.\n *\n * The local date-time is resolved to a single instant on the time-line.\n * This is achieved by finding a valid offset from UTC/Greenwich for the local\n * date-time as defined by the {@link ZoneRules} of the zone ID.\n *\n * In most cases, there is only one valid offset for a local date-time.\n * In the case of an overlap, where clocks are set back, there are two valid offsets.\n * This method uses the earlier offset typically corresponding to 'summer'.\n *\n * In the case of a gap, where clocks jump forward, there is no valid offset.\n * Instead, the local date-time is adjusted to be later by the length of the gap.\n * For a typical one hour daylight savings change, the local date-time will be\n * moved one hour later into the offset typically corresponding to 'summer'.\n *\n * To obtain the later offset during an overlap, call\n * {@link ZonedDateTime#withLaterOffsetAtOverlap} on the result of this method.\n * To throw an exception when there is a gap or overlap, use\n * {@link ZonedDateTime#ofStrict}.\n *\n * @param {ZoneId} zone the time-zone to use, not null\n * @return {ZonedDateTime} the zoned date-time formed from this date-time, not null\n */\n atZone(zone) {\n return ZonedDateTime.of(this, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the {@link LocalDate} part of this date-time.\n *\n * This returns a {@link LocalDate} with the same year, month and day\n * as this date-time.\n *\n * @return {LocalDate} the date part of this date-time, not null\n */\n toLocalDate() {\n return this._date;\n }\n\n /**\n * Gets the {@link LocalTime} part of this date-time.\n *\n * This returns a {@link LocalTime} with the same hour, minute, second and\n * nanosecond as this date-time.\n *\n * @return {LocalTime} the time part of this date-time, not null\n */\n toLocalTime() {\n return this._time;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this date-time to another date-time.\n *\n * The comparison is primarily based on the date-time, from earliest to latest.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * If all the date-times being compared are instances of {@link LocalDateTime},\n * then the comparison will be entirely based on the date-time.\n * If some dates being compared are in different chronologies, then the\n * chronology is also considered, see {@link ChronoLocalDateTime#compareTo}.\n *\n * @param {!LocalDateTime} other - the other date-time 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, LocalDateTime, 'other');\n return this._compareTo0(other);\n // return super.compareTo(other); if not instance of LocalDateTime\n }\n\n /**\n *\n * @param {!LocalDateTime} other\n * @returns {number}\n * @private\n */\n _compareTo0(other) {\n let cmp = this._date.compareTo(other.toLocalDate());\n if (cmp === 0) {\n cmp = this._time.compareTo(other.toLocalTime());\n }\n return cmp;\n }\n\n /**\n * Checks if this date-time is after the specified date-time.\n *\n * This checks to see if this date-time represents a point on the\n * local time-line after the other date-time.\n *
\n * LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00);\n * LocalDate b = LocalDateTime.of(2012, 7, 1, 12, 00);\n * a.isAfter(b) == false\n * a.isAfter(a) == false\n * b.isAfter(a) == true\n *\n *\n * This method only considers the position of the two date-times on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_TIME_COMPARATOR}.\n *\n * @param {LocalDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this date-time is after the specified date-time\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n // return super.isAfter(other); if not instance of LocalDateTime\n }\n\n /**\n * Checks if this date-time is before the specified date-time.\n *\n * This checks to see if this date-time represents a point on the\n * local time-line before the other date-time.\n *
\n * LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00);\n * LocalDate b = LocalDateTime.of(2012, 7, 1, 12, 00);\n * a.isBefore(b) == true\n * a.isBefore(a) == false\n * b.isBefore(a) == false\n *\n *\n * This method only considers the position of the two date-times on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_TIME_COMPARATOR}.\n *\n * @param {LocalDateTime} other - the other date-time to compare to, not null\n * @return {boolean} true if this date-time is before the specified date-time\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n // return super.isBefore(other); if not instance of LocalDateTime\n }\n\n /**\n * Checks if this date-time is equal to the specified date-time.\n *\n * This checks to see if this date-time represents the same point on the\n * local time-line as the other date-time.\n *
\n * LocalDate a = LocalDateTime.of(2012, 6, 30, 12, 00);\n * LocalDate b = LocalDateTime.of(2012, 7, 1, 12, 00);\n * a.isEqual(b) == false\n * a.isEqual(a) == true\n * b.isEqual(a) == false\n *\n *\n * This method only considers the position of the two date-times on the local time-line.\n * It does not take into account the chronology, or calendar system.\n * This is different from the comparison in {@link compareTo},\n * but is the same approach as {@link DATE_TIME_COMPARATOR}.\n *\n * @param {*} other - the other date-time to compare to, not null\n * @return {boolean} true if this date-time is equal to the specified date-time\n */\n isEqual(other) {\n return this.compareTo(other) === 0;\n // return super.isEqual(other); if not instance of LocalDateTime\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this date-time is equal to another date-time.\n *\n * Compares this {@link LocalDateTime} with another ensuring that the date-time is the same.\n * Only objects of type {@link LocalDateTime} are compared, other types return false.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other date-time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof LocalDateTime) {\n return this._date.equals(other._date) && this._time.equals(other._time);\n }\n return false;\n }\n\n /**\n * A hash code for this date-time.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return this._date.hashCode() ^ this._time.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this date-time as a string, such as `2007-12-03T10:15:30`.\n *\n * The output will be one of the following ISO-8601 formats:\n *\n * * `yyyy-MM-dd'T'HH:mm`\n * * `yyyy-MM-dd'T'HH:mm:ss`\n * * `yyyy-MM-dd'T'HH:mm:ss.SSS`\n * * `yyyy-MM-dd'T'HH:mm:ss.SSSSSS`\n * * `yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS`\n *\n * The format used will be the shortest that outputs the full value of\n * the time where the omitted parts are implied to be zero.\n *\n * @return {string} a string representation of this date-time, not null\n */\n toString() {\n return this._date.toString() + 'T' + this._time.toString();\n }\n\n /**\n *\n * @return {string} same as {@link LocalDateTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this date-time as a string using the formatter.\n *\n * @param {!DateTimeFormatter} formatter the formatter to use, not null\n * @return {String} the formatted date-time 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\nexport function _init(){\n /**\n * The minimum supported {@link LocalDateTime}, '-999999999-01-01T00:00:00'.\n * This is the local date-time of midnight at the start of the minimum date.\n * This combines {@link LocalDate#MIN} and {@link LocalTime#MIN}.\n * This could be used by an application as a 'far past' date-time.\n */\n LocalDateTime.MIN = LocalDateTime.of(LocalDate.MIN, LocalTime.MIN);\n\n /**\n * The maximum supported {@link LocalDateTime}, '+999999999-12-31T23:59:59.999999999'.\n * This is the local date-time just before midnight at the end of the maximum date.\n * This combines {@link LocalDate#MAX} and {@link LocalTime#MAX}.\n * This could be used by an application as a 'far future' date-time.\n */\n LocalDateTime.MAX = LocalDateTime.of(LocalDate.MAX, LocalTime.MAX);\n\n LocalDateTime.FROM = createTemporalQuery('LocalDateTime.FROM', (temporal) => {\n return LocalDateTime.from(temporal);\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\n\nimport {MathUtil} from './MathUtil';\nimport {assert, requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException, IllegalArgumentException} from './errors';\n\nimport {Clock} from './Clock';\nimport {LocalDateTime} from './LocalDateTime';\nimport {ZoneId} from './ZoneId';\n\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\n\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {Temporal} from './temporal/Temporal';\nimport {TemporalField} from './temporal/TemporalField';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\n\n/**\n * A time without time-zone in the ISO-8601 calendar system,\n * such as `10:15:30`.\n *\n * {@link LocalTime} is an immutable date-time object that represents a time,\n * often viewed as hour-minute-second.\n * Time is represented to nanosecond precision.\n * For example, the value '13:45.30.123456789' can be stored in a {@link LocalTime}.\n *\n * It does not store or represent a date or time-zone.\n * Instead, it is a description of the local time as seen on a wall clock.\n * It cannot represent an instant on the time-line without additional information\n * such as an offset or time-zone.\n *\n * The ISO-8601 calendar system is the modern civil calendar system used today\n * in most of the world. This API assumes that all calendar systems use the same\n * representation, this class, for time-of-day.\n *\n * ### Static properties of Class {@link LocalTime}\n *\n * LocalTime.MIN\n *\n * The minimum supported {@link LocalTime}, '00:00'.\n * This is the time of midnight at the start of the day.\n *\n * LocalTime.MAX\n *\n * The maximum supported {@link LocalTime}, '23:59:59.999999999'.\n * This is the time just before midnight at the end of the day.\n *\n * LocalTime.MIDNIGHT\n *\n * The time of midnight at the start of the day, '00:00'.\n *\n * LocalTime.NOON\n *\n * The time of noon in the middle of the day, '12:00'.\n *\n * LocalTime.HOURS_PER_DAY\n *\n * Hours per day.\n *\n * LocalTime.MINUTES_PER_HOUR\n *\n * Minutes per hour.\n *\n * LocalTime.MINUTES_PER_DAY\n *\n * Minutes per day.\n *\n * LocalTime.SECONDS_PER_MINUTE\n *\n * Seconds per minute.\n *\n * LocalTime.SECONDS_PER_HOUR\n *\n * Seconds per hour.\n *\n * LocalTime.SECONDS_PER_DAY\n *\n * Seconds per day.\n *\n * LocalTime.MILLIS_PER_DAY\n *\n * Milliseconds per day.\n *\n * LocalTime.MICROS_PER_DAY\n *\n * Microseconds per day.\n *\n * LocalTime.NANOS_PER_SECOND\n *\n * Nanos per second.\n *\n * LocalTime.NANOS_PER_MINUTE\n *\n * Nanos per minute.\n *\n * LocalTime.NANOS_PER_HOUR\n *\n * Nanos per hour.\n *\n * LocalTime.NANOS_PER_DAY\n *\n * Nanos per day.\n *\n */\nexport class LocalTime extends Temporal /** implements Temporal, TemporalAdjuster */ {\n /**\n * Obtains the current time from the specified clock.\n * If no argument is specified the system default clock is queried,\n * if a zone-id is passed a system clock with the specified zone is queried.\n *\n * This will query the specified clock to obtain the current time.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection.\n *\n * @param {Clock|ZoneId} clockOrZone - the zone ID or clock to use, if null Clock.systemDefaultZone() is used.\n * @return {LocalTime} the current time using the system clock, not null\n */\n static now(clockOrZone) {\n if (clockOrZone == null){\n return LocalTime._now(Clock.systemDefaultZone());\n } else if (clockOrZone instanceof Clock){\n return LocalTime._now(clockOrZone);\n } else {\n return LocalTime._now(Clock.system(clockOrZone));\n }\n }\n\n /**\n * Obtains the current time from the specified clock.\n *\n * This will query the specified clock to obtain the current time.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using dependency injection (see {@link Clock}).\n *\n * @param {Clock} [clock=Clock.systemDefaultZone()] - the clock to use, not null\n * @return {LocalTime} the current time, not null\n */\n static _now(clock = Clock.systemDefaultZone()) {\n requireNonNull(clock, 'clock');// inline OffsetTime factory to avoid creating object and InstantProvider checks\n return LocalTime.ofInstant(clock.instant(), clock.zone());\n }\n\n /**\n * obtain a LocalTime from an Instant in the specified time-zone or, if null\n * in the system default time-zone\n *\n * @param {!Instant} instant\n * @param {ZoneId} [zone=ZoneId.systemDefault()], defaults to ZoneId.systemDefault()\n * @returns {LocalTime} the current date, not null\n */\n static ofInstant(instant, zone=ZoneId.systemDefault()){\n const offset = zone.rules().offset(instant);\n let secsOfDay = MathUtil.intMod(instant.epochSecond(), LocalTime.SECONDS_PER_DAY);\n secsOfDay = MathUtil.intMod((secsOfDay + offset.totalSeconds()), LocalTime.SECONDS_PER_DAY);\n if (secsOfDay < 0) {\n secsOfDay += LocalTime.SECONDS_PER_DAY;\n }\n return LocalTime.ofSecondOfDay(secsOfDay, instant.nano());\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from an hour, minute, second and nanosecond.\n *\n * This factory may return a cached value, but applications must not rely on this.\n *\n * @param {number} [hour=0] - the hour-of-day to represent, from 0 to 23\n * @param {number} [minute=0] - the minute-of-hour to represent, from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, from 0 to 999,999,999\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if the value of any field is out of range\n */\n static of(hour, minute, second, nanoOfSecond) {\n return new LocalTime(hour, minute, second, nanoOfSecond);\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from a second-of-day value, with\n * associated nanos of second.\n *\n * This factory may return a cached value, but applications must not rely on this.\n *\n * @param {number} [secondOfDay=0] - the second-of-day, from `0` to `24 * 60 * 60 - 1`\n * @param {number} [nanoOfSecond=0] - the nano-of-second, from `0` to `999,999,999`\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if the either input value is invalid\n */\n static ofSecondOfDay(secondOfDay=0, nanoOfSecond=0) {\n ChronoField.SECOND_OF_DAY.checkValidValue(secondOfDay);\n ChronoField.NANO_OF_SECOND.checkValidValue(nanoOfSecond);\n const hours = MathUtil.intDiv(secondOfDay, LocalTime.SECONDS_PER_HOUR);\n secondOfDay -= hours * LocalTime.SECONDS_PER_HOUR;\n const minutes = MathUtil.intDiv(secondOfDay, LocalTime.SECONDS_PER_MINUTE);\n secondOfDay -= minutes * LocalTime.SECONDS_PER_MINUTE;\n return new LocalTime(hours, minutes, secondOfDay, nanoOfSecond);\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from a nanos-of-day value.\n *\n * This factory may return a cached value, but applications must not rely on this.\n *\n * @param {number} [nanoOfDay=0] - the nano of day, from `0` to `24 * 60 * 60 * 1,000,000,000 - 1`\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if the nanos of day value is invalid\n */\n static ofNanoOfDay(nanoOfDay=0) {\n ChronoField.NANO_OF_DAY.checkValidValue(nanoOfDay);\n const hours = MathUtil.intDiv(nanoOfDay, LocalTime.NANOS_PER_HOUR);\n nanoOfDay -= hours * LocalTime.NANOS_PER_HOUR;\n const minutes = MathUtil.intDiv(nanoOfDay, LocalTime.NANOS_PER_MINUTE);\n nanoOfDay -= minutes * LocalTime.NANOS_PER_MINUTE;\n const seconds = MathUtil.intDiv(nanoOfDay, LocalTime.NANOS_PER_SECOND);\n nanoOfDay -= seconds * LocalTime.NANOS_PER_SECOND;\n return new LocalTime(hours, minutes, seconds, nanoOfDay);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link LocalTime} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link LocalTime}.\n *\n * The conversion uses the {@link TemporalQueries#localTime} query, which relies\n * on extracting {@link ChronoField#NANO_OF_DAY}.\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 LocalTime::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {LocalTime} the local time, not null\n * @throws {DateTimeException} if unable to convert to a {@link LocalTime}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n const time = temporal.query(TemporalQueries.localTime());\n if (time == null) {\n throw new DateTimeException(`Unable to obtain LocalTime TemporalAccessor: ${temporal}, type ${temporal.constructor != null ? temporal.constructor.name : ''}`);\n }\n return time;\n }\n\n /**\n * Obtains an instance of {@link LocalTime} from a text string using a specific formatter.\n *\n * The text is parsed using the formatter, returning a time.\n *\n * @param {!String} text - the text to parse, not null\n * @param {DateTimeFormatter} [formatter=DateTimeFormatter.ISO_LOCAL_TIME] - the formatter to use, default is\n * {@link DateTimeFormatter.ISO_LOCAL_TIME}\n * @return {LocalTime} the parsed local time, not null\n * @throws {DateTimeParseException} if the text cannot be parsed\n */\n static parse(text, formatter=DateTimeFormatter.ISO_LOCAL_TIME) {\n requireNonNull(formatter, 'formatter');\n return formatter.parse(text, LocalTime.FROM);\n }\n\n /**\n * Constructor, previously validated.\n *\n * @param {number} [hour=0] - the hour-of-day to represent, validated from 0 to 23\n * @param {number} [minute=0] - the minute-of-hour to represent, validated from 0 to 59\n * @param {number} [second=0] - the second-of-minute to represent, validated from 0 to 59\n * @param {number} [nanoOfSecond=0] - the nano-of-second to represent, validated from 0 to 999,999,999\n * @private\n */\n constructor(hour=0, minute=0, second=0, nanoOfSecond=0) {\n super();\n const _hour = MathUtil.safeToInt(hour);\n const _minute = MathUtil.safeToInt(minute);\n const _second = MathUtil.safeToInt(second);\n const _nanoOfSecond = MathUtil.safeToInt(nanoOfSecond);\n LocalTime._validate(_hour, _minute, _second, _nanoOfSecond);\n if ((_minute | _second | _nanoOfSecond) === 0) {\n if (!LocalTime.HOURS[_hour]) {\n this._hour = _hour;\n this._minute = _minute;\n this._second = _second;\n this._nano = _nanoOfSecond;\n LocalTime.HOURS[_hour] = this;\n }\n return LocalTime.HOURS[_hour];\n }\n this._hour = _hour;\n this._minute = _minute;\n this._second = _second;\n this._nano = _nanoOfSecond;\n }\n\n static _validate(hour, minute, second, nanoOfSecond){\n ChronoField.HOUR_OF_DAY.checkValidValue(hour);\n ChronoField.MINUTE_OF_HOUR.checkValidValue(minute);\n ChronoField.SECOND_OF_MINUTE.checkValidValue(second);\n ChronoField.NANO_OF_SECOND.checkValidValue(nanoOfSecond);\n\n }\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this time can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} 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 * * {@link ChronoField.NANO_OF_SECOND}\n * * {@link ChronoField.NANO_OF_DAY}\n * * {@link ChronoField.MICRO_OF_SECOND}\n * * {@link ChronoField.MICRO_OF_DAY}\n * * {@link ChronoField.MILLI_OF_SECOND}\n * * {@link ChronoField.MILLI_OF_DAY}\n * * {@link ChronoField.SECOND_OF_MINUTE}\n * * {@link ChronoField.SECOND_OF_DAY}\n * * {@link ChronoField.MINUTE_OF_HOUR}\n * * {@link ChronoField.MINUTE_OF_DAY}\n * * {@link ChronoField.HOUR_OF_AMPM}\n * * {@link ChronoField.CLOCK_HOUR_OF_AMPM}\n * * {@link ChronoField.HOUR_OF_DAY}\n * * {@link ChronoField.CLOCK_HOUR_OF_DAY}\n * * {@link ChronoField.AMPM_OF_DAY}\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 {ChronoField|ChronoUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this time, false if not\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit.isTimeBased();\n } else if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isTimeBased();\n }\n return fieldOrUnit != null && fieldOrUnit.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 time 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 supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 {ChronoField} 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 */\n range(field) {\n requireNonNull(field);\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this time as an `int`.\n *\n * This queries this time 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 supported fields (see {@link isSupported}) will return valid\n * values based on this time, except {@link ChronoField.NANO_OF_DAY} and {@link ChronoField.MICRO_OF_DAY}\n * which are too large to fit in an `int` and throw a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 {ChronoField} 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 {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this time as a `long`.\n *\n * This queries this time 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 supported fields (see {@link isSupported}) will return valid\n * values based on this time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\n *\n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.from}\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 {ChronoField} 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 {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n return this._get0(field);\n }\n return field.getFrom(this);\n }\n\n /**\n *\n * @param {ChronoField} field\n * @returns {number}\n * @private\n */\n _get0(field) {\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return this._nano;\n case ChronoField.NANO_OF_DAY: return this.toNanoOfDay();\n case ChronoField.MICRO_OF_SECOND: return MathUtil.intDiv(this._nano, 1000);\n case ChronoField.MICRO_OF_DAY: return MathUtil.intDiv(this.toNanoOfDay(), 1000);\n case ChronoField.MILLI_OF_SECOND: return MathUtil.intDiv(this._nano, 1000000);\n case ChronoField.MILLI_OF_DAY: return MathUtil.intDiv(this.toNanoOfDay(), 1000000);\n case ChronoField.SECOND_OF_MINUTE: return this._second;\n case ChronoField.SECOND_OF_DAY: return this.toSecondOfDay();\n case ChronoField.MINUTE_OF_HOUR: return this._minute;\n case ChronoField.MINUTE_OF_DAY: return this._hour * 60 + this._minute;\n case ChronoField.HOUR_OF_AMPM: return MathUtil.intMod(this._hour, 12);\n case ChronoField.CLOCK_HOUR_OF_AMPM: {\n const ham = MathUtil.intMod(this._hour, 12);\n return (ham % 12 === 0 ? 12 : ham);\n }\n case ChronoField.HOUR_OF_DAY: return this._hour;\n case ChronoField.CLOCK_HOUR_OF_DAY: return (this._hour === 0 ? 24 : this._hour);\n case ChronoField.AMPM_OF_DAY: return MathUtil.intDiv(this._hour, 12);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the hour-of-day field.\n *\n * @return {number} the hour-of-day, from 0 to 23\n */\n hour() {\n return this._hour;\n }\n\n /**\n * Gets the minute-of-hour field.\n *\n * @return {number} the minute-of-hour, from 0 to 59\n */\n minute() {\n return this._minute;\n }\n\n /**\n * Gets the second-of-minute field.\n *\n * @return {number} the second-of-minute, from 0 to 59\n */\n second() {\n return this._second;\n }\n\n /**\n * Gets the nano-of-second field.\n *\n * @return {number} the nano-of-second, from 0 to 999,999,999\n */\n nano() {\n return this._nano;\n }\n\n /**\n * function overloading for {@link LocalDate.with}\n *\n * if called with 1 (or less) arguments {@link LocalTime.withTemporalAdjuster} is called.\n * Otherwise {@link LocalTime.with2} is called.\n *\n * @param {!(TemporalAdjuster|ChronoField)} adjusterOrField\n * @param {number} newValue - only required if called with 2 arguments\n * @return {LocalTime}\n */\n with(adjusterOrField, newValue){\n if(arguments.length < 2){\n return this.withTemporalAdjuster(adjusterOrField);\n } else {\n return this.with2(adjusterOrField, newValue);\n }\n }\n\n /**\n * Returns an adjusted copy of this time.\n *\n * This returns a new {@link LocalTime}, based on this one, with the time 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 hour field.\n * A more complex adjuster might set the time to the last hour of the day.\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 {LocalTime} a {@link LocalTime} 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 withTemporalAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n // optimizations\n if (adjuster instanceof LocalTime) {\n return adjuster;\n }\n assert(typeof adjuster.adjustInto === 'function', 'adjuster', IllegalArgumentException);\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this time with the specified field set to a new value.\n *\n * This returns a new {@link LocalTime}, 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 hour, minute or second.\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 *\n * * {@link ChronoField.NANO_OF_SECOND} -\n * Returns a {@link LocalTime} with the specified nano-of-second.\n * The hour, minute and second will be unchanged.\n * * {@link ChronoField.NANO_OF_DAY} -\n * Returns a {@link LocalTime} with the specified nano-of-day.\n * This completely replaces the time and is equivalent to {@link ofNanoOfDay}.\n * * {@link ChronoField.MICRO_OF_SECOND} -\n * Returns a {@link LocalTime} with the nano-of-second replaced by the specified\n * micro-of-second multiplied by 1,000.\n * The hour, minute and second will be unchanged.\n * * {@link ChronoField.MICRO_OF_DAY} -\n * Returns a {@link LocalTime} with the specified micro-of-day.\n * This completely replaces the time and is equivalent to using {@link ofNanoOfDay}\n * with the micro-of-day multiplied by 1,000.\n * * {@link ChronoField.MILLI_OF_SECOND} -\n * Returns a {@link LocalTime} with the nano-of-second replaced by the specified\n * milli-of-second multiplied by 1,000,000.\n * The hour, minute and second will be unchanged.\n * * {@link ChronoField.MILLI_OF_DAY} -\n * Returns a {@link LocalTime} with the specified milli-of-day.\n * This completely replaces the time and is equivalent to using {@link ofNanoOfDay}\n * with the milli-of-day multiplied by 1,000,000.\n * * {@link ChronoField.SECOND_OF_MINUTE} -\n * Returns a {@link LocalTime} with the specified second-of-minute.\n * The hour, minute and nano-of-second will be unchanged.\n * * {@link ChronoField.SECOND_OF_DAY} -\n * Returns a {@link LocalTime} with the specified second-of-day.\n * The nano-of-second will be unchanged.\n * * {@link ChronoField.MINUTE_OF_HOUR} -\n * Returns a {@link LocalTime} with the specified minute-of-hour.\n * The hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.MINUTE_OF_DAY} -\n * Returns a {@link LocalTime} with the specified minute-of-day.\n * The second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.HOUR_OF_AMPM} -\n * Returns a {@link LocalTime} with the specified hour-of-am-pm.\n * The AM/PM, minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.CLOCK_HOUR_OF_AMPM} -\n * Returns a {@link LocalTime} with the specified clock-hour-of-am-pm.\n * The AM/PM, minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.HOUR_OF_DAY} -\n * Returns a {@link LocalTime} with the specified hour-of-day.\n * The minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.CLOCK_HOUR_OF_DAY} -\n * Returns a {@link LocalTime} with the specified clock-hour-of-day.\n * The minute-of-hour, second-of-minute and nano-of-second will be unchanged.\n * * {@link ChronoField.AMPM_OF_DAY} -\n * Returns a {@link LocalTime} with the specified AM/PM.\n * The hour-of-am-pm, minute-of-hour, second-of-minute and nano-of-second 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 {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 {LocalTime} a {@link LocalTime} based on this with the specified field set, not null\n * @throws {DateTimeException} if the field cannot be set\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n with2(field, newValue) {\n requireNonNull(field, 'field');\n requireInstance(field, TemporalField, 'field');\n if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return this.withNano(newValue);\n case ChronoField.NANO_OF_DAY: return LocalTime.ofNanoOfDay(newValue);\n case ChronoField.MICRO_OF_SECOND: return this.withNano(newValue * 1000);\n case ChronoField.MICRO_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000);\n case ChronoField.MILLI_OF_SECOND: return this.withNano( newValue * 1000000);\n case ChronoField.MILLI_OF_DAY: return LocalTime.ofNanoOfDay(newValue * 1000000);\n case ChronoField.SECOND_OF_MINUTE: return this.withSecond(newValue);\n case ChronoField.SECOND_OF_DAY: return this.plusSeconds(newValue - this.toSecondOfDay());\n case ChronoField.MINUTE_OF_HOUR: return this.withMinute(newValue);\n case ChronoField.MINUTE_OF_DAY: return this.plusMinutes(newValue - (this._hour * 60 + this._minute));\n case ChronoField.HOUR_OF_AMPM: return this.plusHours(newValue - MathUtil.intMod(this._hour, 12));\n case ChronoField.CLOCK_HOUR_OF_AMPM: return this.plusHours((newValue === 12 ? 0 : newValue) - MathUtil.intMod(this._hour, 12));\n case ChronoField.HOUR_OF_DAY: return this.withHour(newValue);\n case ChronoField.CLOCK_HOUR_OF_DAY: return this.withHour((newValue === 24 ? 0 : newValue));\n case ChronoField.AMPM_OF_DAY: return this.plusHours((newValue - MathUtil.intDiv(this._hour, 12)) * 12);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the hour-of-day value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [hour=0] - the hour-of-day to set in the result, from 0 to 23\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested hour, not null\n * @throws {DateTimeException} if the hour value is invalid\n */\n withHour(hour=0) {\n if (this._hour === hour) {\n return this;\n }\n return new LocalTime(hour, this._minute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the minute-of-hour value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [minute=0] - the minute-of-hour to set in the result, from 0 to 59\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested minute, not null\n * @throws {DateTimeException} if the minute value is invalid\n */\n withMinute(minute=0) {\n if (this._minute === minute) {\n return this;\n }\n return new LocalTime(this._hour, minute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the second-of-minute value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [second=0] - the second-of-minute to set in the result, from 0 to 59\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested second, not null\n * @throws {DateTimeException} if the second value is invalid\n */\n withSecond(second=0) {\n if (this._second === second) {\n return this;\n }\n return new LocalTime(this._hour, this._minute, second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the nano-of-second value altered.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} [nanoOfSecond=0] - the nano-of-second to set in the result, from 0 to 999,999,999\n * @return {LocalTime} a {@link LocalTime} based on this time with the requested nanosecond, not null\n * @throws {DateTimeException} if the nanos value is invalid\n */\n withNano(nanoOfSecond=0) {\n if (this._nano === nanoOfSecond) {\n return this;\n }\n return new LocalTime(this._hour, this._minute, this._second, nanoOfSecond);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the time truncated.\n *\n * Truncating the time returns a copy of the original time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with the {@link ChronoUnit.MINUTES} minutes unit\n * will set the second-of-minute and nano-of-second field to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit.DAYS}. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!ChronoUnit} unit - the unit to truncate to, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the time truncated, not null\n * @throws {DateTimeException} if unable to truncate\n */\n truncatedTo(unit) {\n requireNonNull(unit, 'unit');\n if (unit === ChronoUnit.NANOS) {\n return this;\n }\n const unitDur = unit.duration();\n if (unitDur.seconds() > LocalTime.SECONDS_PER_DAY) {\n throw new DateTimeException('Unit is too large to be used for truncation');\n }\n const dur = unitDur.toNanos();\n if (MathUtil.intMod(LocalTime.NANOS_PER_DAY, dur) !== 0) {\n throw new DateTimeException('Unit must divide into a standard day without remainder');\n }\n const nod = this.toNanoOfDay();\n return LocalTime.ofNanoOfDay(MathUtil.intDiv(nod, dur) * dur);\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * function overloading for {@link LocalDate.plus}\n *\n * if called with 1 (or less) arguments {@link LocalTime.plus1} is called.\n * Otherwise {@link LocalTime.plus2} is called.\n *\n * @param {!(TemporalAmount|number)} amount\n * @param {ChronoUnit} unit - only required if called with 2 arguments\n * @return {LocalTime}\n */\n plus(amount, unit){\n if(arguments.length < 2){\n return this.plus1(amount);\n } else {\n return this.plus2(amount, unit);\n }\n }\n\n /**\n * Returns a copy of this date with the specified period added.\n *\n * This method returns a new time based on this time with the specified period added.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link plus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to add, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the addition made, not null\n * @throws {DateTimeException} if the addition cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n plus1(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * Returns a copy of this time with the specified period added.\n *\n * This method returns a new time based on this time with the specified period added.\n * This can be used to add any period that is defined by a unit, for example to add hours, minutes or seconds.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\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 period to add, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the specified period added, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n plus2(amountToAdd, unit) {\n requireNonNull(unit, 'unit');\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this.plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MICROS_PER_DAY) * 1000);\n case ChronoUnit.MILLIS: return this.plusNanos(MathUtil.intMod(amountToAdd, LocalTime.MILLIS_PER_DAY) * 1000000);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n case ChronoUnit.MINUTES: return this.plusMinutes(amountToAdd);\n case ChronoUnit.HOURS: return this.plusHours(amountToAdd);\n case ChronoUnit.HALF_DAYS: return this.plusHours(MathUtil.intMod(amountToAdd, 2) * 12);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in hours added.\n *\n * This adds the specified number of hours to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hoursToAdd - the hours to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the hours added, not null\n */\n plusHours(hoursToAdd) {\n if (hoursToAdd === 0) {\n return this;\n }\n\n const newHour = MathUtil.intMod(MathUtil.intMod(hoursToAdd, LocalTime.HOURS_PER_DAY) + this._hour + LocalTime.HOURS_PER_DAY, LocalTime.HOURS_PER_DAY);\n return new LocalTime(newHour, this._minute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in minutes added.\n *\n * This adds the specified number of minutes to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutesToAdd - the minutes to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the minutes added, not null\n */\n plusMinutes(minutesToAdd) {\n if (minutesToAdd === 0) {\n return this;\n }\n const mofd = this._hour * LocalTime.MINUTES_PER_HOUR + this._minute;\n const newMofd = MathUtil.intMod(MathUtil.intMod(minutesToAdd, LocalTime.MINUTES_PER_DAY) + mofd + LocalTime.MINUTES_PER_DAY, LocalTime.MINUTES_PER_DAY);\n if (mofd === newMofd) {\n return this;\n }\n const newHour = MathUtil.intDiv(newMofd, LocalTime.MINUTES_PER_HOUR);\n const newMinute = MathUtil.intMod(newMofd, LocalTime.MINUTES_PER_HOUR);\n return new LocalTime(newHour, newMinute, this._second, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in seconds added.\n *\n * This adds the specified number of seconds to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondstoAdd - the seconds to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the seconds added, not null\n */\n plusSeconds(secondstoAdd) {\n if (secondstoAdd === 0) {\n return this;\n }\n const sofd = this._hour * LocalTime.SECONDS_PER_HOUR +\n this._minute * LocalTime.SECONDS_PER_MINUTE + this._second;\n const newSofd = MathUtil.intMod((MathUtil.intMod(secondstoAdd, LocalTime.SECONDS_PER_DAY) + sofd + LocalTime.SECONDS_PER_DAY), LocalTime.SECONDS_PER_DAY);\n if (sofd === newSofd) {\n return this;\n }\n const newHour = MathUtil.intDiv(newSofd, LocalTime.SECONDS_PER_HOUR);\n const newMinute = MathUtil.intMod(MathUtil.intDiv(newSofd, LocalTime.SECONDS_PER_MINUTE), LocalTime.MINUTES_PER_HOUR);\n const newSecond = MathUtil.intMod(newSofd, LocalTime.SECONDS_PER_MINUTE);\n return new LocalTime(newHour, newMinute, newSecond, this._nano);\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in nanoseconds added.\n *\n * This adds the specified number of nanoseconds to this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToAdd - the nanos to add, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the nanoseconds added, not null\n */\n plusNanos(nanosToAdd) {\n if (nanosToAdd === 0) {\n return this;\n }\n const nofd = this.toNanoOfDay();\n const newNofd = MathUtil.intMod((MathUtil.intMod(nanosToAdd, LocalTime.NANOS_PER_DAY) + nofd + LocalTime.NANOS_PER_DAY), LocalTime.NANOS_PER_DAY);\n if (nofd === newNofd) {\n return this;\n }\n const newHour = MathUtil.intDiv(newNofd, LocalTime.NANOS_PER_HOUR);\n const newMinute = MathUtil.intMod(MathUtil.intDiv(newNofd, LocalTime.NANOS_PER_MINUTE), LocalTime.MINUTES_PER_HOUR);\n const newSecond = MathUtil.intMod(MathUtil.intDiv(newNofd, LocalTime.NANOS_PER_SECOND), LocalTime.SECONDS_PER_MINUTE);\n const newNano = MathUtil.intMod(newNofd, LocalTime.NANOS_PER_SECOND);\n return new LocalTime(newHour, newMinute, newSecond, newNano);\n }\n\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link LocalDate.minus}\n *\n * if called with 1 (or less) arguments {@link LocalTime.minus1} is called.\n * Otherwise {@link LocalTime.minus2} is called.\n *\n * @param {!(TemporalAmount|number)} amount\n * @param {ChronoUnit} unit - only required if called with 2 arguments\n * @return {LocalTime}\n */\n minus(amount, unit){\n if(arguments.length < 2){\n return this.minus1(amount);\n } else {\n return this.minus2(amount, unit);\n }\n }\n\n /**\n * Returns a copy of this time with the specified period subtracted.\n *\n * This method returns a new time based on this time with the specified period subtracted.\n * The amount is typically {@link Period} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n * The calculation is delegated to the specified adjuster, which typically calls\n * back to {@link minus}.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAmount} amount - the amount to subtract, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the subtraction made, not null\n * @throws {DateTimeException} if the subtraction cannot be made\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n\n minus1(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this time with the specified period subtracted.\n *\n * This method returns a new time based on this time with the specified period subtracted.\n * This can be used to subtract any period that is defined by a unit, for example to subtract hours, minutes or seconds.\n * The unit is responsible for the details of the calculation, including the resolution\n * of any edge cases in the calculation.\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 {ChronoUnit} unit - the unit of the period to subtract, not null\n * @return {LocalTime} a {@link LocalTime} based on this time with the specified period subtracted, not null\n * @throws {DateTimeException} if the unit cannot be added to this type\n */\n minus2(amountToSubtract, unit) {\n requireNonNull(unit, 'unit');\n return this.plus2(-1 * amountToSubtract, unit);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in hours subtracted.\n *\n * This subtracts the specified number of hours from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} hoursToSubtract - the hours to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the hours subtracted, not null\n */\n minusHours(hoursToSubtract) {\n return this.plusHours(-1 * MathUtil.intMod(hoursToSubtract, LocalTime.HOURS_PER_DAY));\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in minutes subtracted.\n *\n * This subtracts the specified number of minutes from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} minutesToSubtract - the minutes to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the minutes subtracted, not null\n */\n minusMinutes(minutesToSubtract) {\n return this.plusMinutes(-1 * MathUtil.intMod(minutesToSubtract, LocalTime.MINUTES_PER_DAY));\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in seconds subtracted.\n *\n * This subtracts the specified number of seconds from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToSubtract - the seconds to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the seconds subtracted, not null\n */\n minusSeconds(secondsToSubtract) {\n return this.plusSeconds(-1 * MathUtil.intMod(secondsToSubtract, LocalTime.SECONDS_PER_DAY));\n }\n\n /**\n * Returns a copy of this {@link LocalTime} with the specified period in nanoseconds subtracted.\n *\n * This subtracts the specified number of nanoseconds from this time, returning a new time.\n * The calculation wraps around midnight.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToSubtract - the nanos to subtract, may be negative\n * @return {LocalTime} a {@link LocalTime} based on this time with the nanoseconds subtracted, not null\n */\n minusNanos(nanosToSubtract) {\n return this.plusNanos(-1 * MathUtil.intMod(nanosToSubtract, LocalTime.NANOS_PER_DAY));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this time using the specified query.\n *\n * This queries this time 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 if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n } else if (query === TemporalQueries.localTime()) {\n return this;\n }\n // inline TemporalAccessor.super.query(query) as an optimization\n if (query === TemporalQueries.chronology() || query === TemporalQueries.zoneId() ||\n query === TemporalQueries.zone() || query === TemporalQueries.offset() ||\n query === TemporalQueries.localDate()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have the same time as this object.\n *\n * This returns a temporal object of the same observable type as the input\n * with the time changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.NANO_OF_DAY} as the field.\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 = thisLocalTime.adjustInto(temporal);\n * temporal = temporal.with(thisLocalTime);\n *\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAdjuster} 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(LocalTime.NANO_OF_DAY, this.toNanoOfDay());\n }\n\n /**\n * Calculates the period between this time and another time in\n * terms of the specified unit.\n *\n * This calculates the period between two times in terms of a single unit.\n * The start and end points are this and the specified time.\n * The result will be negative if the end is before the start.\n * The {@link Temporal} passed to this method must be a {@link LocalTime}.\n * For example, the period in hours between two times can be calculated\n * using {@link startTime.until}.\n *\n * The calculation returns a whole number, representing the number of\n * complete units between the two times.\n * For example, the period in hours between 11:30 and 13:29 will only\n * be one hour as it is one minute short of two hours.\n *\n * This method operates in association with {@link TemporalUnit.between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n * long period = start.until(end, HOURS); // this method\n * dateTime.plus(HOURS.between(start, end)); // use in plus/minus\n *\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link ChronoUnit.NANOS}, {@link ChronoUnit.MICROS}, {@link ChronoUnit.MILLIS}, {@link ChronoUnit.SECONDS},\n * {@link ChronoUnit.MINUTES}, {@link ChronoUnit.HOURS} and {@link ChronoUnit.HALF_DAYS} are supported.\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 input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {TemporalAccessor} endExclusive - the end time, which is converted to a {@link LocalTime}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this time and the end time\n * @throws {DateTimeException} if the period cannot be calculated\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = LocalTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n const nanosUntil = end.toNanoOfDay() - this.toNanoOfDay(); // no overflow\n switch (unit) {\n case ChronoUnit.NANOS: return nanosUntil;\n case ChronoUnit.MICROS: return MathUtil.intDiv(nanosUntil, 1000);\n case ChronoUnit.MILLIS: return MathUtil.intDiv(nanosUntil, 1000000);\n case ChronoUnit.SECONDS: return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_SECOND);\n case ChronoUnit.MINUTES: return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_MINUTE);\n case ChronoUnit.HOURS: return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_HOUR);\n case ChronoUnit.HALF_DAYS: return MathUtil.intDiv(nanosUntil, (12 * LocalTime.NANOS_PER_HOUR));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this time with a date to create a {@link LocalDateTime}.\n *\n * This returns a {@link LocalDateTime} formed from this time at the specified date.\n * All possible combinations of date and time are valid.\n *\n * @param {LocalDate} date - the date to combine with, not null\n * @return {LocalDateTime} the local date-time formed from this time and the specified date, not null\n */\n atDate(date) {\n return LocalDateTime.of(date, this);\n }\n\n /**\n * Combines this time with an offset to create an {@link OffsetTime}.\n *\n * This returns an {@link OffsetTime} formed from this time at the specified offset.\n * All possible combinations of time and offset are valid.\n *\n * @param {OffsetTime} offset - the offset to combine with, not null\n * @return {OffsetTime} the offset time formed from this time and the specified offset, not null\n */\n /*\n atOffset(offset) {\n return OffsetTime.of(this, offset);\n }\n*/\n\n //-----------------------------------------------------------------------\n /**\n * Extracts the time as seconds of day, from `0` to `24 * 60 * 60 - 1`.\n *\n * @return {number} the second-of-day equivalent to this time\n */\n toSecondOfDay() {\n let total = this._hour * LocalTime.SECONDS_PER_HOUR;\n total += this._minute * LocalTime.SECONDS_PER_MINUTE;\n total += this._second;\n return total;\n }\n\n /**\n * Extracts the time as nanos of day, from `0` to `24 * 60 * 60 * 1,000,000,000 - 1`.\n *\n * @return {number} the nano of day equivalent to this time\n */\n toNanoOfDay() {\n let total = this._hour * LocalTime.NANOS_PER_HOUR;\n total += this._minute * LocalTime.NANOS_PER_MINUTE;\n total += this._second * LocalTime.NANOS_PER_SECOND;\n total += this._nano;\n return total;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this {@link LocalTime} to another time.\n *\n * The comparison is based on the time-line position of the local times within a day.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param {LocalTime} other - the other time to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n * @throws {NullPointerException} if `other` is null\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, LocalTime, 'other');\n let cmp = MathUtil.compareNumbers(this._hour, other._hour);\n if (cmp === 0) {\n cmp = MathUtil.compareNumbers(this._minute, other._minute);\n if (cmp === 0) {\n cmp = MathUtil.compareNumbers(this._second, other._second);\n if (cmp === 0) {\n cmp = MathUtil.compareNumbers(this._nano, other._nano);\n }\n }\n }\n return cmp;\n }\n\n /**\n * Checks if this {@link LocalTime} is after the specified time.\n *\n * The comparison is based on the time-line position of the time within a day.\n *\n * @param {LocalTime} other - the other time to compare to, not null\n * @return {boolean} true if this is after the specified time\n * @throws {NullPointerException} if `other` is null\n */\n isAfter(other) {\n return this.compareTo(other) > 0;\n }\n\n /**\n * Checks if this {@link LocalTime} is before the specified time.\n *\n * The comparison is based on the time-line position of the time within a day.\n *\n * @param {LocalTime} other - the other time to compare to, not null\n * @return {boolean} true if this point is before the specified time\n * @throws {NullPointerException} if `other` is null\n */\n isBefore(other) {\n return this.compareTo(other) < 0;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this time is equal to another time.\n *\n * The comparison is based on the time-line position of the time within a day.\n *\n * Only objects of type {@link LocalTime} are compared, other types return false.\n * To compare the date of two {@link TemporalAccessor} instances, use\n * {@link ChronoField#NANO_OF_DAY} as a comparator.\n *\n * @param {*} other - the object to check, null returns false\n * @return {boolean} true if this is equal to the other time\n */\n equals(other) {\n if (this === other) {\n return true;\n }\n if (other instanceof LocalTime) {\n return this._hour === other._hour && this._minute === other._minute &&\n this._second === other._second && this._nano === other._nano;\n }\n return false;\n }\n\n /**\n * A hash code for this time.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n const nod = this.toNanoOfDay();\n return MathUtil.hash(nod);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this time as a string, such as `10:15`.\n *\n * The output will be one of the following ISO-8601 formats:\n *\n * * {@link HH:mm}\n * * {@link HH:mm:ss}\n * * {@link HH:mm:ss.SSS}\n * * {@link HH:mm:ss.SSSSSS}\n * * {@link HH:mm:ss.SSSSSSSSS}\n *\n * The format used will be the shortest that outputs the full value of\n * the time where the omitted parts are implied to be zero.\n *\n * @return {string} a string representation of this time, not null\n */\n toString() {\n let buf = '';\n const hourValue = this._hour;\n const minuteValue = this._minute;\n const secondValue = this._second;\n const nanoValue = this._nano;\n buf += hourValue < 10 ? '0' : '';\n buf += hourValue;\n buf += minuteValue < 10 ? ':0' : ':';\n buf += minuteValue;\n if (secondValue > 0 || nanoValue > 0) {\n buf += secondValue < 10 ? ':0' : ':';\n buf += secondValue;\n if (nanoValue > 0) {\n buf += '.';\n if(MathUtil.intMod(nanoValue, 1000000) === 0) {\n buf += ('' + (MathUtil.intDiv(nanoValue, 1000000) + 1000)).substring(1);\n } else if (MathUtil.intMod(nanoValue, 1000) === 0) {\n buf += ('' + (MathUtil.intDiv(nanoValue, 1000) + 1000000)).substring(1);\n } else {\n buf += ('' + (nanoValue + 1000000000)).substring(1);\n }\n }\n }\n return buf;\n }\n\n /**\n *\n * @return {string} same as {@link LocalTime.toString}\n */\n toJSON() {\n return this.toString();\n }\n\n /**\n * Outputs this time as a string using the formatter.\n *\n * @param {DateTineFormatter} formatter - the formatter to use, not null\n * @return {string} the formatted time 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\nexport function _init() {\n /**\n * Constants for the local time of each hour.\n */\n LocalTime.HOURS = [];\n for (let hour = 0; hour < 24; hour++) {\n LocalTime.of(hour, 0, 0, 0);\n }\n\n /**\n * The minimum supported {@link LocalTime}, '00:00'.\n * This is the time of midnight at the start of the day.\n */\n LocalTime.MIN = LocalTime.HOURS[0];\n /**\n * The maximum supported {@link LocalTime}, '23:59:59.999999999'.\n * This is the time just before midnight at the end of the day.\n */\n LocalTime.MAX = new LocalTime(23, 59, 59, 999999999);\n /**\n * The time of midnight at the start of the day, '00:00'.\n */\n LocalTime.MIDNIGHT = LocalTime.HOURS[0];\n /**\n * The time of noon in the middle of the day, '12:00'.\n */\n LocalTime.NOON = LocalTime.HOURS[12];\n\n LocalTime.FROM = createTemporalQuery('LocalTime.FROM', (temporal) => {\n return LocalTime.from(temporal);\n });\n}\n\n/**\n * Hours per day.\n */\nLocalTime.HOURS_PER_DAY = 24;\n/**\n * Minutes per hour.\n */\nLocalTime.MINUTES_PER_HOUR = 60;\n/**\n * Minutes per day.\n */\nLocalTime.MINUTES_PER_DAY = LocalTime.MINUTES_PER_HOUR * LocalTime.HOURS_PER_DAY;\n/**\n * Seconds per minute.\n */\nLocalTime.SECONDS_PER_MINUTE = 60;\n/**\n * Seconds per hour.\n */\nLocalTime.SECONDS_PER_HOUR = LocalTime.SECONDS_PER_MINUTE * LocalTime.MINUTES_PER_HOUR;\n/**\n * Seconds per day.\n */\nLocalTime.SECONDS_PER_DAY = LocalTime.SECONDS_PER_HOUR * LocalTime.HOURS_PER_DAY;\n/**\n * Milliseconds per day.\n */\nLocalTime.MILLIS_PER_DAY = LocalTime.SECONDS_PER_DAY * 1000;\n/**\n * Microseconds per day.\n */\nLocalTime.MICROS_PER_DAY = LocalTime.SECONDS_PER_DAY * 1000000;\n/**\n * Nanos per second.\n */\nLocalTime.NANOS_PER_SECOND = 1000000000;\n/**\n * Nanos per minute.\n */\nLocalTime.NANOS_PER_MINUTE = LocalTime.NANOS_PER_SECOND * LocalTime.SECONDS_PER_MINUTE;\n/**\n * Nanos per hour.\n */\nLocalTime.NANOS_PER_HOUR = LocalTime.NANOS_PER_MINUTE * LocalTime.MINUTES_PER_HOUR;\n/**\n * Nanos per day.\n */\nLocalTime.NANOS_PER_DAY = LocalTime.NANOS_PER_HOUR * LocalTime.HOURS_PER_DAY;\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 {requireNonNull, requireInstance} from './assert';\nimport {DateTimeException, UnsupportedTemporalTypeException} from './errors';\n\nimport {Clock} from './Clock';\nimport {LocalTime} from './LocalTime';\nimport {ZonedDateTime} from './ZonedDateTime';\nimport {MathUtil} from './MathUtil';\n\nimport {Temporal} from './temporal/Temporal';\nimport {ChronoField} from './temporal/ChronoField';\nimport {ChronoUnit} from './temporal/ChronoUnit';\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {TemporalUnit} from './temporal/TemporalUnit';\nimport {createTemporalQuery} from './temporal/TemporalQuery';\nimport {DateTimeFormatter} from './format/DateTimeFormatter';\n\nconst NANOS_PER_MILLI = 1000000;\n\n/**\n * An instantaneous point on the time-line.\n *\n * This class models a single instantaneous point on the time-line.\n * This might be used to record event time-stamps in the application.\n *\n * Time-scale\n *\n * The length of the solar day is the standard way that humans measure time.\n * This has traditionally been subdivided into 24 hours of 60 minutes of 60 seconds,\n * forming a 86400 second day.\n *\n * Modern timekeeping is based on atomic clocks which precisely define an SI second\n * relative to the transitions of a Caesium atom. The length of an SI second was defined\n * to be very close to the 86400th fraction of a day.\n *\n * Unfortunately, as the Earth rotates the length of the day varies.\n * In addition, over time the average length of the day is getting longer as the Earth slows.\n * As a result, the length of a solar day in 2012 is slightly longer than 86400 SI seconds.\n * The actual length of any given day and the amount by which the Earth is slowing\n * are not predictable and can only be determined by measurement.\n * The UT1 time-scale captures the accurate length of day, but is only available some\n * time after the day has completed.\n *\n * The UTC time-scale is a standard approach to bundle up all the additional fractions\n * of a second from UT1 into whole seconds, known as *leap-seconds*.\n * A leap-second may be added or removed depending on the Earth's rotational changes.\n * As such, UTC permits a day to have 86399 SI seconds or 86401 SI seconds where\n * necessary in order to keep the day aligned with the Sun.\n *\n * The modern UTC time-scale was introduced in 1972, introducing the concept of whole leap-seconds.\n * Between 1958 and 1972, the definition of UTC was complex, with minor sub-second leaps and\n * alterations to the length of the notional second. As of 2012, discussions are underway\n * to change the definition of UTC again, with the potential to remove leap seconds or\n * introduce other changes.\n *\n * Given the complexity of accurate timekeeping described above, this Java API defines\n * its own time-scale, the *Java Time-Scale*.\n *\n * The Java Time-Scale divides each calendar day into exactly 86400\n * subdivisions, known as seconds. These seconds may differ from the\n * SI second. It closely matches the de facto international civil time\n * scale, the definition of which changes from time to time.\n *\n * The Java Time-Scale has slightly different definitions for different\n * segments of the time-line, each based on the consensus international\n * time scale that is used as the basis for civil time. Whenever the\n * internationally-agreed time scale is modified or replaced, a new\n * segment of the Java Time-Scale must be defined for it. Each segment\n * must meet these requirements:\n *\n * * the Java Time-Scale shall closely match the underlying international\n * civil time scale;\n * * the Java Time-Scale shall exactly match the international civil\n * time scale at noon each day;\n * * the Java Time-Scale shall have a precisely-defined relationship to\n * the international civil time scale.\n *\n * There are currently, as of 2013, two segments in the Java time-scale.\n *\n * For the segment from 1972-11-03 (exact boundary discussed below) until\n * further notice, the consensus international time scale is UTC (with\n * leap seconds). In this segment, the Java Time-Scale is identical to\n * [UTC-SLS](http://www.cl.cam.ac.uk/~mgk25/time/utc-sls/).\n * This is identical to UTC on days that do not have a leap second.\n * On days that do have a leap second, the leap second is spread equally\n * over the last 1000 seconds of the day, maintaining the appearance of\n * exactly 86400 seconds per day.\n *\n * For the segment prior to 1972-11-03, extending back arbitrarily far,\n * the consensus international time scale is defined to be UT1, applied\n * proleptically, which is equivalent to the (mean) solar time on the\n * prime meridian (Greenwich). In this segment, the Java Time-Scale is\n * identical to the consensus international time scale. The exact\n * boundary between the two segments is the instant where UT1 = UTC\n * between 1972-11-03T00:00 and 1972-11-04T12:00.\n *\n * Implementations of the Java time-scale using the JSR-310 API are not\n * required to provide any clock that is sub-second accurate, or that\n * progresses monotonically or smoothly. Implementations are therefore\n * not required to actually perform the UTC-SLS slew or to otherwise be\n * aware of leap seconds. JSR-310 does, however, require that\n * implementations must document the approach they use when defining a\n * clock representing the current instant.\n * See {@link Clock} for details on the available clocks.\n *\n * The Java time-scale is used for all date-time classes.\n * This includes {@link Instant}, {@link LocalDate}, {@link LocalTime}, {@link OffsetDateTime},\n * {@link ZonedDateTime} and {@link Duration}.\n *\n * ### Static properties of Class {@link Instant}\n *\n * Instant.EPOCH\n *\n * Instant.MIN\n *\n * Instant.MAX\n *\n * Instant.MIN_SECONDS\n *\n * Instant.MAX_SECONDS\n *\n */\nexport class Instant extends Temporal {\n\n /**\n * Obtains the current instant from the system clock, or if specified\n * the current instant from the specified clock.\n *\n * This will query the specified clock to obtain the current time.\n *\n * @param {Clock} [clock=Clock.systemUTC()] - the clock to use, defaults to the system clock\n * @return {Instant} the current instant, not null\n */\n static now(clock = Clock.systemUTC()){\n return clock.instant();\n }\n\n /**\n * Obtains an instance of {@link Instant} using seconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * @param {number} epochSecond - the number of seconds from 1970-01-01T00:00:00Z\n * @param {number} nanoAdjustment nanoseconds start from the start of epochSecond, if null the nanosecond field is set to zero.\n * @return {Instant} an instant, not null\n * @throws DateTimeException if the instant exceeds the maximum or minimum instant\n */\n static ofEpochSecond(epochSecond, nanoAdjustment=0){\n const secs = epochSecond + MathUtil.floorDiv(nanoAdjustment, LocalTime.NANOS_PER_SECOND);\n const nos = MathUtil.floorMod(nanoAdjustment, LocalTime.NANOS_PER_SECOND);\n return Instant._create(secs, nos);\n }\n\n /**\n * Obtains an instance of {@link Instant} using milliseconds from the\n * epoch of 1970-01-01T00:00:00Z.\n *\n * The seconds and nanoseconds are extracted from the specified milliseconds.\n *\n * @param {number} epochMilli - the number of milliseconds from 1970-01-01T00:00:00Z\n * @return {Instant} an instant, not null\n * @throws DateTimeException if the instant exceeds the maximum or minimum instant\n */\n static ofEpochMilli(epochMilli) {\n const secs = MathUtil.floorDiv(epochMilli, 1000);\n const mos = MathUtil.floorMod(epochMilli, 1000);\n return Instant._create(secs, mos * 1000000);\n }\n\n /**\n * Obtains an instance of {@link Instant} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link Instant}.\n *\n * The conversion extracts the {@link ChronoField#INSTANT_SECONDS}\n * and {@link ChronoField#NANO_OF_SECOND} fields.\n *\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@link Instant::from}.\n *\n * @param {TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {Instant} the instant, not null\n * @throws DateTimeException if unable to convert to an {@link Instant}\n */\n static from(temporal) {\n try {\n const instantSecs = temporal.getLong(ChronoField.INSTANT_SECONDS);\n const nanoOfSecond = temporal.get(ChronoField.NANO_OF_SECOND);\n return Instant.ofEpochSecond(instantSecs, nanoOfSecond);\n } catch (ex) {\n throw new DateTimeException('Unable to obtain Instant from TemporalAccessor: ' +\n temporal + ', type ' + typeof temporal, ex);\n }\n }\n\n /**\n * Obtains an instance of {@link Instant} from a text string such as\n * `2007-12-03T10:15:30.000Z`.\n *\n * The string must represent a valid instant in UTC and is parsed using\n * {@link DateTimeFormatter#ISO_INSTANT}.\n *\n * @param {string} text - the text to parse, not null\n * @return {Instant} the parsed instant, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n return DateTimeFormatter.ISO_INSTANT.parse(text, Instant.FROM);\n }\n\n /**\n *\n * @param {number} seconds\n * @param {number} nanoOfSecond\n * @returns {Instant}\n * @private\n */\n static _create(seconds, nanoOfSecond){\n if(seconds === 0 && nanoOfSecond === 0){\n return Instant.EPOCH;\n }\n return new Instant(seconds, nanoOfSecond);\n }\n\n /**\n *\n * @param {number} seconds\n * @param {number} nanoOfSecond\n * @private\n */\n static _validate(seconds, nanoOfSecond){\n if (seconds < Instant.MIN_SECONDS || seconds > Instant.MAX_SECONDS) {\n throw new DateTimeException('Instant exceeds minimum or maximum instant');\n }\n if (nanoOfSecond < 0 || nanoOfSecond > LocalTime.NANOS_PER_SECOND) {\n throw new DateTimeException('Instant exceeds minimum or maximum instant');\n }\n }\n\n /**\n *\n * @param {number} seconds\n * @param {number} nanoOfSecond\n * @private\n */\n constructor(seconds, nanoOfSecond){\n super();\n Instant._validate(seconds, nanoOfSecond);\n this._seconds = MathUtil.safeToInt(seconds);\n this._nanos = MathUtil.safeToInt(nanoOfSecond);\n }\n\n /**\n * Checks if the specified field is supported.\n *\n * This checks if this instant can be queried for the specified field.\n * If false, then calling {@link range} and {@link get} 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 * * {@link NANO_OF_SECOND}\n * * {@link MICRO_OF_SECOND}\n * * {@link MILLI_OF_SECOND}\n * * {@link INSTANT_SECONDS}\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|TemporalUnit} fieldOrUnit - the field to check, null returns false\n * @return {boolean} true if the field is supported on this instant, false if not\n */\n isSupported(fieldOrUnit) {\n if (fieldOrUnit instanceof ChronoField) {\n return fieldOrUnit === ChronoField.INSTANT_SECONDS || fieldOrUnit === ChronoField.NANO_OF_SECOND || fieldOrUnit === ChronoField.MICRO_OF_SECOND || fieldOrUnit === ChronoField.MILLI_OF_SECOND;\n }\n if (fieldOrUnit instanceof ChronoUnit) {\n return fieldOrUnit.isTimeBased() || fieldOrUnit === ChronoUnit.DAYS;\n }\n return fieldOrUnit != null && fieldOrUnit.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 instant 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 supported fields (see {@link isSupported}) will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 */\n range(field) {\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this instant as an `int`.\n *\n * This queries this instant 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 supported fields (see {@link isSupported}) will return valid\n * values based on this date-time, except {@link INSTANT_SECONDS} which is too\n * large to fit in an `int` and throws a {@link DateTimeException}.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n * Gets the value of the specified field from this instant as a `long`.\n *\n * This queries this instant 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 supported fields (see {@link isSupported}) will return valid\n * values based on this date-time.\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return this._nanos;\n case ChronoField.MICRO_OF_SECOND: return MathUtil.intDiv(this._nanos, 1000);\n case ChronoField.MILLI_OF_SECOND: return MathUtil.intDiv(this._nanos, NANOS_PER_MILLI);\n case ChronoField.INSTANT_SECONDS: return this._seconds;\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n /**\n * Gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z.\n *\n * The epoch second count is a simple incrementing count of seconds where\n * second 0 is 1970-01-01T00:00:00Z.\n * The nanosecond part of the day is returned by {@link getNanosOfSecond}.\n *\n * @return {number} the seconds from the epoch of 1970-01-01T00:00:00Z\n */\n epochSecond(){\n return this._seconds;\n }\n\n /**\n * Gets the number of nanoseconds, later along the time-line, from the start\n * of the second.\n *\n * The nanosecond-of-second value measures the total number of nanoseconds from\n * the second returned by {@link getEpochSecond}.\n *\n * @return {number} the nanoseconds within the second, always positive, never exceeds 999,999,999\n */\n nano(){\n return this._nanos;\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Instant.with}\n *\n * if called with 1 argument {@link Instant.withTemporalAdjuster} is called\n * otherwise {@link Instant.with2}\n *\n * @param {!(TemporalAdjuster|TemporalField)} adjusterOrField\n * @param {number} newValue\n * @returns {Instant}\n */\n with(adjusterOrField, newValue){\n if(arguments.length === 1){\n return this.withTemporalAdjuster(adjusterOrField);\n } else {\n return this.with2(adjusterOrField, newValue);\n }\n }\n /**\n * Returns an adjusted copy of this instant.\n *\n * This returns a new {@link Instant}, 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 * 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 {Instant} an {@link Instant} 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 withTemporalAdjuster(adjuster) {\n requireNonNull(adjuster, 'adjuster');\n return adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this instant with the specified field set to a new value.\n *\n * This returns a new {@link Instant}, based on this one, with the value\n * for the specified field changed.\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 *\n * * {@link NANO_OF_SECOND} -\n * Returns an {@link Instant} with the specified nano-of-second.\n * The epoch-second will be unchanged.\n * * {@link MICRO_OF_SECOND} -\n * Returns an {@link Instant} with the nano-of-second replaced by the specified\n * micro-of-second multiplied by 1,000. The epoch-second will be unchanged.\n * * {@link MILLI_OF_SECOND} -\n * Returns an {@link Instant} with the nano-of-second replaced by the specified\n * milli-of-second multiplied by 1,000,000. The epoch-second will be unchanged.\n * * {@link INSTANT_SECONDS} -\n * Returns an {@link Instant} with the specified epoch-second.\n * The nano-of-second will be unchanged.\n *\n *\n * In all cases, if the new value is outside the valid range of values for the field\n * then a {@link DateTimeException} will be thrown.\n *\n * All other {@link ChronoField} instances will throw a {@link DateTimeException}.\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 {Instant} an {@link Instant} based on `this` with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws ArithmeticException if numeric overflow occurs\n */\n with2(field, newValue) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n field.checkValidValue(newValue);\n switch (field) {\n case ChronoField.MILLI_OF_SECOND: {\n const nval = newValue * NANOS_PER_MILLI;\n return (nval !== this._nanos? Instant._create(this._seconds, nval) : this);\n }\n case ChronoField.MICRO_OF_SECOND: {\n const nval = newValue * 1000;\n return (nval !== this._nanos? Instant._create(this._seconds, nval) : this);\n }\n case ChronoField.NANO_OF_SECOND: return (newValue !== this._nanos? Instant._create(this._seconds, newValue) : this);\n case ChronoField.INSTANT_SECONDS: return (newValue !== this._seconds ? Instant._create(newValue, this._nanos) : this);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@link Instant} truncated to the specified unit.\n *\n * Truncating the instant returns a copy of the original with fields\n * smaller than the specified unit set to zero.\n * The fields are calculated on the basis of using a UTC offset as seen\n * in {@link toString}.\n * For example, truncating with {@link ChronoUnit#MINUTES} will\n * round down to the nearest minute, setting the seconds and nanoseconds to zero.\n *\n * The unit must have a duration (see {@link TemporalUnit#getDuration})\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS}. Other units throw an exception.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {!TemporalUnit} unit - the unit to truncate to, not null\n * @return {Instant} an {@link Instant} based on this instant with the time truncated, not null\n * @throws DateTimeException if the unit is invalid for truncation\n */\n truncatedTo(unit) {\n requireNonNull(unit, 'unit');\n if (unit === ChronoUnit.NANOS) {\n return this;\n }\n const unitDur = unit.duration();\n if (unitDur.seconds() > LocalTime.SECONDS_PER_DAY) {\n throw new DateTimeException('Unit is too large to be used for truncation');\n }\n const dur = unitDur.toNanos();\n if (MathUtil.intMod(LocalTime.NANOS_PER_DAY, dur) !== 0) {\n throw new DateTimeException('Unit must divide into a standard day without remainder');\n }\n const nod = MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + this._nanos;\n const result = MathUtil.intDiv(nod, dur) * dur;\n return this.plusNanos(result - nod);\n }\n\n //-----------------------------------------------------------------------\n /**\n *\n * @param {TemporalAmount|number} amount\n * @param {TemporalUnit} unit - only required if first param is a TemporalAmount\n * @return {Instant}\n */\n plus(amount, unit){\n if(arguments.length === 1){\n return this.plus1(amount);\n } else {\n return this.plus2(amount, unit);\n }\n }\n\n /**\n * @param {!TemporalAmount} amount\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n plus1(amount) {\n requireNonNull(amount, 'amount');\n return amount.addTo(this);\n }\n\n /**\n * @param {!number} amountToAdd\n * @param {!TemporalUnit} unit\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n plus2(amountToAdd, unit) {\n requireNonNull(amountToAdd, 'amountToAdd');\n requireNonNull(unit, 'unit');\n requireInstance(unit, TemporalUnit);\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this.plusNanos(amountToAdd);\n case ChronoUnit.MICROS: return this._plus(MathUtil.intDiv(amountToAdd, 1000000), MathUtil.intMod(amountToAdd, 1000000) * 1000);\n case ChronoUnit.MILLIS: return this.plusMillis(amountToAdd);\n case ChronoUnit.SECONDS: return this.plusSeconds(amountToAdd);\n case ChronoUnit.MINUTES: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_MINUTE));\n case ChronoUnit.HOURS: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_HOUR));\n case ChronoUnit.HALF_DAYS: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_DAY / 2));\n case ChronoUnit.DAYS: return this.plusSeconds(MathUtil.safeMultiply(amountToAdd, LocalTime.SECONDS_PER_DAY));\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in seconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToAdd the seconds to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified seconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n plusSeconds(secondsToAdd) {\n return this._plus(secondsToAdd, 0);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in milliseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} millisToAdd - the milliseconds to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified milliseconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n * @throws ArithmeticException if numeric overflow occurs\n */\n plusMillis(millisToAdd) {\n return this._plus(MathUtil.intDiv(millisToAdd, 1000), MathUtil.intMod(millisToAdd, 1000) * NANOS_PER_MILLI);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in nanoseconds added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToAdd - the nanoseconds to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified nanoseconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n plusNanos(nanosToAdd) {\n return this._plus(0, nanosToAdd);\n }\n\n /**\n * Returns a copy of this instant with the specified duration added.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToAdd - the seconds to add, positive or negative\n * @param {number} nanosToAdd - the nanos to add, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified seconds added, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n _plus(secondsToAdd, nanosToAdd) {\n if ((secondsToAdd | nanosToAdd) === 0) {\n return this;\n }\n let epochSec = this._seconds + secondsToAdd;\n epochSec = epochSec + MathUtil.intDiv(nanosToAdd, LocalTime.NANOS_PER_SECOND);\n const nanoAdjustment = this._nanos + nanosToAdd % LocalTime.NANOS_PER_SECOND;\n return Instant.ofEpochSecond(epochSec, nanoAdjustment);\n }\n\n //-----------------------------------------------------------------------\n /**\n *\n * @param {TemporalAmount|number} amount\n * @param {TemporalUnit} unit - only required if first param is a TemporalAmount\n * @return {Instant}\n */\n minus(amount, unit){\n if(arguments.length === 1){\n return this.minus1(amount);\n } else {\n return this.minus2(amount, unit);\n }\n }\n\n /**\n * @param {!TemporalAmount} amount\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n minus1(amount) {\n requireNonNull(amount, 'amount');\n return amount.subtractFrom(this);\n }\n\n /**\n * @param {!number} amountToSubtract\n * @param {!TemporalUnit} unit\n * @return {Instant}\n * @throws DateTimeException\n * @throws ArithmeticException\n */\n minus2(amountToSubtract, unit) {\n return this.plus2(-1 * amountToSubtract, unit);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in seconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} secondsToSubtract - the seconds to subtract, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified seconds subtracted, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n */\n minusSeconds(secondsToSubtract) {\n return this.plusSeconds(secondsToSubtract * -1);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in milliseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} millisToSubtract - the milliseconds to subtract, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified milliseconds subtracted, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusMillis(millisToSubtract) {\n return this.plusMillis(-1 * millisToSubtract);\n }\n\n /**\n * Returns a copy of this instant with the specified duration in nanoseconds subtracted.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {number} nanosToSubtract the nanoseconds to subtract, positive or negative\n * @return {Instant} an {@link Instant} based on this instant with the specified nanoseconds subtracted, not null\n * @throws DateTimeException if the result exceeds the maximum or minimum instant\n * @throws ArithmeticException if numeric overflow occurs\n */\n minusNanos(nanosToSubtract) {\n return this.plusNanos(-1 * nanosToSubtract);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Queries this instant using the specified query.\n *\n * This queries this instant 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 if (query === TemporalQueries.precision()) {\n return ChronoUnit.NANOS;\n }\n // inline TemporalAccessor.super.query(query) as an optimization\n if (query === TemporalQueries.localDate() || query === TemporalQueries.localTime() ||\n query === TemporalQueries.chronology() || query === TemporalQueries.zoneId() ||\n query === TemporalQueries.zone() || query === TemporalQueries.offset()) {\n return null;\n }\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have this instant.\n *\n * This returns a temporal object of the same observable type as the input\n * with the instant changed to be the same as this.\n *\n * The adjustment is equivalent to using {@link Temporal#with}\n * twice, passing {@link ChronoField#INSTANT_SECONDS} and\n * {@link ChronoField#NANO_OF_SECOND} as the fields.\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 = thisInstant.adjustInto(temporal);\n * temporal = temporal.with(thisInstant);\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 return temporal.with(ChronoField.INSTANT_SECONDS, this._seconds).with(ChronoField.NANO_OF_SECOND, this._nanos);\n }\n\n /**\n * Calculates the period between this instant and another instant in\n * terms of the specified unit.\n *\n * This calculates the period between two instants in terms of a single unit.\n * The start and end points are `this` and the specified instant.\n * The result will be negative if the end is before the start.\n * The calculation returns a whole number, representing the number of\n * complete units between the two instants.\n * The {@link Temporal} passed to this method is converted to a\n * {@link Instant} using {@link from}.\n * For example, the period in days between two dates can be calculated\n * using `startInstant.until(endInstant, SECONDS)`.\n *\n * This method operates in association with {@link TemporalUnit#between}.\n * The result of this method is a `long` representing the amount of\n * the specified unit. By contrast, the result of {@link between} is an\n * object that can be used directly in addition/subtraction:\n *
\n * long period = start.until(end, SECONDS); // this method\n * dateTime.plus(SECONDS.between(start, end)); // use in plus/minus\n *\n *\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@link NANOS}, {@link MICROS}, {@link MILLIS}, {@link SECONDS},\n * {@link MINUTES}, {@link HOURS}, {@link HALF_DAYS} and {@link DAYS}\n * are supported. 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 input temporal as\n * the second argument.\n *\n * This instance is immutable and unaffected by this method call.\n *\n * @param {Temporal} endExclusive - the end date, which is converted to an {@link Instant}, not null\n * @param {TemporalUnit} unit - the unit to measure the period in, not null\n * @return {number} the amount of the period between this date and the end date\n * @throws DateTimeException if the period cannot be calculated\n * @throws ArithmeticException if numeric overflow occurs\n */\n until(endExclusive, unit) {\n requireNonNull(endExclusive, 'endExclusive');\n requireNonNull(unit, 'unit');\n const end = Instant.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n switch (unit) {\n case ChronoUnit.NANOS: return this._nanosUntil(end);\n case ChronoUnit.MICROS: return MathUtil.intDiv(this._nanosUntil(end), 1000);\n case ChronoUnit.MILLIS: return MathUtil.safeSubtract(end.toEpochMilli(), this.toEpochMilli());\n case ChronoUnit.SECONDS: return this._secondsUntil(end);\n case ChronoUnit.MINUTES: return MathUtil.intDiv(this._secondsUntil(end), LocalTime.SECONDS_PER_MINUTE);\n case ChronoUnit.HOURS: return MathUtil.intDiv(this._secondsUntil(end), LocalTime.SECONDS_PER_HOUR);\n case ChronoUnit.HALF_DAYS: return MathUtil.intDiv(this._secondsUntil(end), (12 * LocalTime.SECONDS_PER_HOUR));\n case ChronoUnit.DAYS: return MathUtil.intDiv(this._secondsUntil(end), LocalTime.SECONDS_PER_DAY);\n }\n throw new UnsupportedTemporalTypeException('Unsupported unit: ' + unit);\n }\n return unit.between(this, end);\n }\n\n /**\n *\n * @param {Temporal} end\n * @returns {number}\n * @private\n */\n _nanosUntil(end) {\n const secsDiff = MathUtil.safeSubtract(end.epochSecond(), this.epochSecond());\n const totalNanos = MathUtil.safeMultiply(secsDiff, LocalTime.NANOS_PER_SECOND);\n return MathUtil.safeAdd(totalNanos, end.nano() - this.nano());\n }\n\n /**\n *\n * @param {Temporal} end\n * @returns {number}\n * @private\n */\n _secondsUntil(end) {\n let secsDiff = MathUtil.safeSubtract(end.epochSecond(), this.epochSecond());\n const nanosDiff = end.nano() - this.nano();\n if (secsDiff > 0 && nanosDiff < 0) {\n secsDiff--;\n } else if (secsDiff < 0 && nanosDiff > 0) {\n secsDiff++;\n }\n return secsDiff;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this instant with an offset to create an {@link OffsetDateTime}.\n *\n * This returns an {@link OffsetDateTime} formed from this instant at the\n * specified offset from UTC/Greenwich. An exception will be thrown if the\n * instant is too large to fit into an offset date-time.\n *\n * This method is equivalent to {@link OffsetDateTime#ofInstant}.\n *\n * @param {ZoneOffset} offset - the offset to combine with, not null\n * @return {OffsetDateTime} the offset date-time formed from this instant and the specified offset, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n //atOffset(offset) {\n // return OffsetDateTime.ofInstant(this, offset);\n //}\n\n /**\n * Combines this instant with a time-zone to create a {@link ZonedDateTime}.\n *\n * This returns an {@link ZonedDateTime} formed from this instant at the\n * specified time-zone. An exception will be thrown if the instant is too\n * large to fit into a zoned date-time.\n *\n * This method is equivalent to {@link ZonedDateTime#ofInstant}.\n *\n * @param {ZoneId} zone - the zone to combine with, not null\n * @return {ZonedDateTime} the zoned date-time formed from this instant and the specified zone, not null\n * @throws DateTimeException if the result exceeds the supported range\n */\n atZone(zone) {\n return ZonedDateTime.ofInstant(this, zone);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Converts this instant to the number of milliseconds from the epoch\n * of 1970-01-01T00:00:00Z.\n *\n * If this instant represents a point on the time-line too far in the future\n * or past to fit in a `long` milliseconds, then an exception is thrown.\n *\n * If this instant has greater than millisecond precision, then the conversion\n * will drop any excess precision information as though the amount in nanoseconds\n * was subject to integer division by one million.\n *\n * @return {number} the number of milliseconds since the epoch of 1970-01-01T00:00:00Z\n * @throws ArithmeticException if numeric overflow occurs\n */\n toEpochMilli() {\n const millis = MathUtil.safeMultiply(this._seconds, 1000);\n return millis + MathUtil.intDiv(this._nanos, NANOS_PER_MILLI);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this instant to the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param {Instant} otherInstant the other instant to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n * @throws NullPointerException if otherInstant is null\n */\n compareTo(otherInstant) {\n requireNonNull(otherInstant, 'otherInstant');\n requireInstance(otherInstant, Instant, 'otherInstant');\n const cmp = MathUtil.compareNumbers(this._seconds, otherInstant._seconds);\n if (cmp !== 0) {\n return cmp;\n }\n return this._nanos - otherInstant._nanos;\n }\n\n /**\n * Checks if this instant is after the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n *\n * @param {Instant} otherInstant the other instant to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n * @throws NullPointerException if otherInstant is null\n */\n isAfter(otherInstant) {\n return this.compareTo(otherInstant) > 0;\n }\n\n /**\n * Checks if this instant is before the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n *\n * @param {Instant} otherInstant the other instant to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n * @throws NullPointerException if otherInstant is null\n */\n isBefore(otherInstant) {\n return this.compareTo(otherInstant) < 0;\n }\n\n /**\n * Checks if this instant is equal to the specified instant.\n *\n * The comparison is based on the time-line position of the instants.\n *\n * @param {*} otherInstant - the other instant, null/ undefined returns false\n * @return {boolean} true if the other instant is equal to this one\n */\n equals(otherInstant) {\n if(this === otherInstant){\n return true;\n }\n if(otherInstant instanceof Instant){\n return this.epochSecond() === otherInstant.epochSecond() &&\n this.nano() === otherInstant.nano();\n }\n return false;\n }\n\n /**\n * Returns a hash code for this instant.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n return MathUtil.hashCode(this._seconds, this._nanos);\n }\n\n /**\n * A string representation of this instant using ISO-8601 representation.\n *\n * The format used is the same as {@link DateTimeFormatter#ISO_INSTANT}.\n *\n * @return {string} an ISO-8601 representation of this instant, not null\n */\n toString(){\n return DateTimeFormatter.ISO_INSTANT.format(this);\n }\n\n /**\n *\n * @return {string} same as {@link LocalDate.toString}\n */\n toJSON() {\n return this.toString();\n }\n}\n\nexport function _init() {\n Instant.MIN_SECONDS = -31619119219200; // -1000000-01-01T00:00:00Z\n Instant.MAX_SECONDS = 31494816403199; // +1000000-12-31T23:59:59.999999999Z\n Instant.EPOCH = new Instant(0, 0);\n Instant.MIN = Instant.ofEpochSecond(Instant.MIN_SECONDS, 0);\n Instant.MAX = Instant.ofEpochSecond(Instant.MAX_SECONDS, 999999999);\n Instant.FROM = createTemporalQuery('Instant.FROM', (temporal) => {\n return Instant.from(temporal);\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 {abstractMethodFail, requireNonNull} from './assert';\nimport {Instant} from './Instant';\nimport {ZoneId} from './ZoneId';\nimport {ZoneOffset} from './ZoneOffset';\n\n/**\n * A clock providing access to the current instant, date and time using a time-zone.\n *\n * Instances of this class are used to find the current instant, which can be\n * interpreted using the stored time-zone to find the current date and time.\n * As such, a clock can be used instead of {@link System#currentTimeMillis}\n * and {@link TimeZone#getDefault}.\n *\n * Use of a {@link Clock} is optional. All key date-time classes also have a\n * `now()` factory method that uses the system clock in the default time zone.\n * The primary purpose of this abstraction is to allow alternate clocks to be\n * plugged in as and when required. Applications use an object to obtain the\n * current time rather than a static method. This can simplify testing.\n *\n * Best practice for applications is to pass a {@link Clock} into any method\n * that requires the current instant.\n *\n * This approach allows an alternate clock, such as {@link fixed}\n * or {@link offset} to be used during testing.\n *\n * The {@link system} factory methods provide clocks based on the best available\n * system clock This may use {@link System#currentTimeMillis}, or a higher\n * resolution clock if one is available.\n *\n * The javascript Clock implementation differs from the openjdk.\n *\n * Javascript only provides the UTC millis of epoch and the ZoneOffset in minutes of the system default time.\n * Javascript do not provide the system default ZoneId.\n *\n * the system default ZoneId is only guessable by the ZoneOffset, like moment-timezone does by returning one ZoneId\n * with the same ZoneOffset.\n *\n * Therefore we are doing a shortcut here, by defining a SystemUTCClock and a SystemDefaultClock, the Clock itself\n * is returning the ZoneOffset and not the ZoneRules as in the jdk. We should change it, when introducing the iana\n * timezone database and implementing the timezone domains.\n *\n */\n\nexport class Clock {\n /**\n * Obtains a clock that returns the current instant using the\n * system clock, converting to date and time using the Date.getTime() UTC millis.\n *\n * This clock, rather than {@link systemDefaultZone}, should be used when\n * you need the current instant without the date or time.\n *\n * @return {Clock} a clock that uses the system clock in the UTC zone, not null\n */\n static systemUTC() {\n return new SystemClock(ZoneOffset.UTC);\n }\n\n /**\n * Obtains a clock that returns the current instant using the best available\n * system clock, converting to date and time using the default time-zone.\n *\n * This clock is based on the available system clock using the Date.getTime() UTC millis\n *\n * Using this method hard codes a dependency to the default time-zone into your application.\n *\n * The UTC clock (see {@link systemUTC}) should be used when you need the current instant\n * without the date or time.\n *\n *\n * @return {Clock} a clock that uses the system clock in the default zone, not null\n * @see ZoneId#systemDefault()\n */\n static systemDefaultZone() {\n return new SystemClock(ZoneId.systemDefault());\n }\n\n /**\n *\n * @param {ZoneId} zone\n * @return {Clock} a clock that uses the specified time zone\n */\n static system(zone){\n return new SystemClock(zone);\n }\n\n /**\n * Obtains a clock that always returns the same instant.\n *\n * This clock simply returns the specified instant.\n * As such, it is not a clock in the conventional sense.\n * The main use case for this is in testing, where the fixed clock ensures\n * tests are not dependent on the current clock.\n *\n * @param {Instant} fixedInstant the instant to use as the clock, not null\n * @param {ZoneId} zoneId the zoneOffset to use as zone Offset, not null\n * @return {Clock} a clock that always returns the same instant, not null\n */\n static fixed(fixedInstant, zoneId) {\n return new FixedClock(fixedInstant, zoneId);\n }\n \n /**\n * Obtains a clock that returns instants from the specified clock with the\n * specified duration added\n *
\n * This clock wraps another clock, returning instants that are later by the\n * specified duration. If the duration is negative, the instants will be\n * earlier than the current date and time.\n * The main use case for this is to simulate running in the future or in the past.\n *
\n * A duration of zero would have no offsetting effect.\n * Passing zero will return the underlying clock.\n *
\n * The returned implementation is immutable, thread-safe and {@code Serializable}\n * providing that the base clock is.\n *\n * @param baseClock the base clock to add the duration to, not null\n * @param offsetDuration the duration to add, not null\n * @return a clock based on the base clock with the duration added, not null\n */\n static offset(baseClock, duration) {\n return new OffsetClock(baseClock, duration); \n }\n\n /**\n * Gets the current millisecond instant of the clock.\n *\n * This returns the millisecond-based instant, measured from 1970-01-01T00:00Z (UTC).\n * This is equivalent to the definition of {@link Date#getTime}.\n *\n * Most applications should avoid this method and use {@link Instant} to represent\n * an instant on the time-line rather than a raw millisecond value.\n * This method is provided to allow the use of the clock in high performance use cases\n * where the creation of an object would be unacceptable.\n *\n * The default implementation currently calls {@link instant}.\n *\n * @return the current millisecond instant from this clock, measured from\n * the Java epoch of 1970-01-01T00:00Z (UTC), not null\n */\n millis(){\n abstractMethodFail('Clock.millis');\n }\n\n /**\n * Gets the current instant of the clock.\n *\n * This returns an instant representing the current instant as defined by the clock.\n *\n * @return {Instant} the current instant from this clock, not null\n */\n instant(){\n abstractMethodFail('Clock.instant');\n }\n\n zone(){\n abstractMethodFail('Clock.zone');\n }\n \n /**\n * Returns a copy of this clock with a different time-zone.\n *
\n * A clock will typically obtain the current instant and then convert that\n * to a date or time using a time-zone. This method returns a clock with\n * similar properties but using a different time-zone.\n *\n * @param zone the time-zone to change to, not null\n * @return a clock based on this clock with the specified time-zone, not null\n */\n withZone(){\n abstractMethodFail('Clock.withZone');\n }\n}\n\n/**\n * Implementation of a clock that always returns the latest time from\n * {@link Date#getTime}.\n *\n * @private\n */\nclass SystemClock extends Clock {\n /**\n *\n * @param {!ZoneId} zone\n */\n constructor(zone){\n requireNonNull(zone, 'zone');\n super();\n this._zone = zone;\n }\n\n /**\n *\n * @returns {!ZoneId}\n */\n zone() {\n return this._zone;\n }\n\n /**\n *\n * @returns {number}\n */\n millis() {\n return new Date().getTime();\n }\n\n /**\n *\n * @returns {Instant}\n */\n instant() {\n return Instant.ofEpochMilli(this.millis());\n }\n \n equals(obj) { \n if (obj instanceof SystemClock) { \n return this._zone.equals(obj._zone);\n }\n return false; \n } \n \n withZone(zone) {\n if (zone.equals(this._zone)) { // intentional NPE\n return this;\n }\n return new SystemClock(zone);\n } \n\n /**\n *\n * @returns {string}\n */\n toString(){\n return 'SystemClock[' + this._zone.toString() + ']';\n }\n\n}\n\n/**\n * Implementation of a clock that always returns the same instant.\n * This is typically used for testing.\n * @private\n */\nclass FixedClock extends Clock{\n constructor(fixedInstant, zoneId) {\n super();\n this._instant = fixedInstant;\n this._zoneId = zoneId;\n }\n\n instant() {\n return this._instant;\n }\n\n millis(){\n return this._instant.toEpochMilli();\n }\n\n zone() {\n return this._zoneId;\n }\n\n toString(){\n return 'FixedClock[]';\n }\n \n equals(obj) { \n if (obj instanceof FixedClock) { \n return this._instant.equals(obj._instant) && this._zoneId.equals(obj._zoneId);\n }\n return false; \n }\n\n withZone(zone) {\n if (zone.equals(this._zoneId)) { // intentional NPE\n return this;\n }\n return new FixedClock(this._instant, zone);\n } \n \n}\n\n\n/**\n * Implementation of a clock that adds an offset to an underlying clock.\n */\nclass OffsetClock extends Clock {\n constructor(baseClock, offset) {\n super();\n this._baseClock = baseClock;\n this._offset = offset;\n }\n \n zone() {\n return this._baseClock.zone();\n }\n \n withZone(zone) {\n if (zone.equals(this._baseClock.zone())) { // intentional NPE\n return this;\n }\n return new OffsetClock(this._baseClock.withZone(zone), this._offset);\n }\n \n millis() {\n return this._baseClock.millis() + this._offset.toMillis();\n }\n \n instant() {\n return this._baseClock.instant().plus(this._offset);\n }\n \n equals(obj) {\n if (obj instanceof OffsetClock) { \n return this._baseClock.equals(obj._baseClock) && this._offset.equals(obj._offset);\n }\n return false;\n }\n \n toString() {\n return 'OffsetClock[' + this._baseClock + ',' + this._offset + ']';\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 {requireNonNull} from '../assert';\nimport {IllegalArgumentException} from '../errors';\n\nimport {Duration} from '../Duration';\nimport {LocalDateTime} from '../LocalDateTime';\n\n/**\n * A transition between two offsets caused by a discontinuity in the local time-line.\n *\n * A transition between two offsets is normally the result of a daylight savings cutover.\n * The discontinuity is normally a gap in spring and an overlap in autumn.\n * {@link ZoneOffsetTransition} models the transition between the two offsets.\n *\n * Gaps occur where there are local date-times that simply do not not exist.\n * An example would be when the offset changes from `+03:00` to `+04:00`.\n * This might be described as 'the clocks will move forward one hour tonight at 1am'.\n *\n * Overlaps occur where there are local date-times that exist twice.\n * An example would be when the offset changes from `+04:00` to `+03:00`.\n * This might be described as 'the clocks will move back one hour tonight at 2am'.\n *\n */\nexport class ZoneOffsetTransition {\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance defining a transition between two offsets.\n *\n * Applications should normally obtain an instance from {@link ZoneRules}.\n * This factory is only intended for use when creating {@link ZoneRules}.\n *\n * @param {LocalDateTime} transition - the transition date-time at the transition, which never\n * actually occurs, expressed local to the before offset, not null\n * @param {ZoneOffset} offsetBefore - the offset before the transition, not null\n * @param {ZoneOffset} offsetAfter - the offset at and after the transition, not null\n * @return {ZoneOffsetTransition} the transition, not null\n * @throws IllegalArgumentException if {@link offsetBefore} and {@link offsetAfter}\n * are equal, or {@link transition.getNano} returns non-zero value\n */\n static of(transition, offsetBefore, offsetAfter) {\n return new ZoneOffsetTransition(transition, offsetBefore, offsetAfter);\n }\n\n /**\n * Creates an instance defining a transition between two offsets.\n * Creates an instance from epoch-second if transition is not a LocalDateTimeInstance\n *\n * @param {(LocalDateTime \\ number)} transition - the transition date-time with the offset before the transition, not null\n * @param {ZoneOffset} offsetBefore - the offset before the transition, not null\n * @param {ZoneOffset} offsetAfter - the offset at and after the transition, not null\n * @private\n */\n constructor(transition, offsetBefore, offsetAfter) {\n requireNonNull(transition, 'transition');\n requireNonNull(offsetBefore, 'offsetBefore');\n requireNonNull(offsetAfter, 'offsetAfter');\n if (offsetBefore.equals(offsetAfter)) {\n throw new IllegalArgumentException('Offsets must not be equal');\n }\n if (transition.nano() !== 0) {\n throw new IllegalArgumentException('Nano-of-second must be zero');\n }\n if(transition instanceof LocalDateTime) {\n this._transition = transition;\n } else {\n this._transition = LocalDateTime.ofEpochSecond(transition, 0, offsetBefore);\n }\n this._offsetBefore = offsetBefore;\n this._offsetAfter = offsetAfter;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the transition instant.\n *\n * This is the instant of the discontinuity, which is defined as the first\n * instant that the 'after' offset applies.\n *\n * The methods {@link getInstant}, {@link getDateTimeBefore} and {@link getDateTimeAfter}\n * all represent the same instant.\n *\n * @return {Instant} the transition instant, not null\n */\n instant() {\n return this._transition.toInstant(this._offsetBefore);\n }\n\n /**\n * Gets the transition instant as an epoch second.\n *\n * @return {number} the transition epoch second\n */\n toEpochSecond() {\n return this._transition.toEpochSecond(this._offsetBefore);\n }\n\n //-------------------------------------------------------------------------\n /**\n * Gets the local transition date-time, as would be expressed with the 'before' offset.\n *\n * This is the date-time where the discontinuity begins expressed with the 'before' offset.\n * At this instant, the 'after' offset is actually used, therefore the combination of this\n * date-time and the 'before' offset will never occur.\n *\n * The combination of the 'before' date-time and offset represents the same instant\n * as the 'after' date-time and offset.\n *\n * @return {LocalDateTime} the transition date-time expressed with the before offset, not null\n */\n dateTimeBefore(){\n return this._transition;\n }\n\n /**\n * Gets the local transition date-time, as would be expressed with the 'after' offset.\n *\n * This is the first date-time after the discontinuity, when the new offset applies.\n *\n * The combination of the 'before' date-time and offset represents the same instant\n * as the 'after' date-time and offset.\n *\n * @return {LocalDateTime} the transition date-time expressed with the after offset, not null\n */\n dateTimeAfter() {\n return this._transition.plusSeconds(this.durationSeconds());\n }\n\n /**\n * Gets the offset before the transition.\n *\n * This is the offset in use before the instant of the transition.\n *\n * @return {ZoneOffset} the offset before the transition, not null\n */\n offsetBefore() {\n return this._offsetBefore;\n }\n\n /**\n * Gets the offset after the transition.\n *\n * This is the offset in use on and after the instant of the transition.\n *\n * @return {ZoneOffset} the offset after the transition, not null\n */\n offsetAfter() {\n return this._offsetAfter;\n }\n\n /**\n * Gets the duration of the transition.\n *\n * In most cases, the transition duration is one hour, however this is not always the case.\n * The duration will be positive for a gap and negative for an overlap.\n * Time-zones are second-based, so the nanosecond part of the duration will be zero.\n *\n * @return {Duration} the duration of the transition, positive for gaps, negative for overlaps\n */\n duration() {\n return Duration.ofSeconds(this.durationSeconds());\n }\n\n /**\n * Gets the duration of the transition in seconds.\n *\n * @return {number} the duration in seconds\n */\n durationSeconds() {\n return this._offsetAfter.totalSeconds() - this._offsetBefore.totalSeconds();\n }\n\n /**\n * Does this transition represent a gap in the local time-line.\n *\n * Gaps occur where there are local date-times that simply do not not exist.\n * An example would be when the offset changes from `+01:00` to `+02:00`.\n * This might be described as 'the clocks will move forward one hour tonight at 1am'.\n *\n * @return {boolean} true if this transition is a gap, false if it is an overlap\n */\n isGap() {\n return this._offsetAfter.totalSeconds() > this._offsetBefore.totalSeconds();\n }\n\n /**\n * Does this transition represent a gap in the local time-line.\n *\n * Overlaps occur where there are local date-times that exist twice.\n * An example would be when the offset changes from `+02:00` to `+01:00`.\n * This might be described as 'the clocks will move back one hour tonight at 2am'.\n *\n * @return {boolean} true if this transition is an overlap, false if it is a gap\n */\n isOverlap() {\n return this._offsetAfter.totalSeconds() < this._offsetBefore.totalSeconds();\n }\n\n /**\n * Checks if the specified offset is valid during this transition.\n *\n * This checks to see if the given offset will be valid at some point in the transition.\n * A gap will always return false.\n * An overlap will return true if the offset is either the before or after offset.\n *\n * @param {ZoneOffset} offset - the offset to check, null returns false\n * @return {boolean} true if the offset is valid during the transition\n */\n isValidOffset(offset) {\n return this.isGap() ? false : (this._offsetBefore.equals(offset) || this._offsetAfter.equals(offset));\n }\n\n /**\n * Gets the valid offsets during this transition.\n *\n * A gap will return an empty list, while an overlap will return both offsets.\n *\n * @return {ZoneOffset[]} the list of valid offsets\n */\n validOffsets() {\n if (this.isGap()){\n return [];\n } else {\n return [this._offsetBefore, this._offsetAfter];\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this transition to another based on the transition instant.\n *\n * This compares the instants of each transition.\n * The offsets are ignored, making this order inconsistent with equals.\n *\n * @param {ZoneOffsetTransition} transition - the transition to compare to, not null\n * @return {number} the comparator value, negative if less, positive if greater\n */\n compareTo(transition) {\n return this.instant().compareTo(transition.instant());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this object equals another.\n *\n * The entire state of the object is compared.\n *\n * @param {*} other - the other object to compare to, null returns false\n * @return true if equal\n */\n equals(other) {\n if (other === this) {\n return true;\n }\n if (other instanceof ZoneOffsetTransition) {\n const d = other;\n return this._transition.equals(d._transition) &&\n this._offsetBefore.equals(d.offsetBefore()) && this._offsetAfter.equals(d.offsetAfter());\n }\n return false;\n }\n\n /**\n * Returns a suitable hash code.\n *\n * @return {number} the hash code\n */\n hashCode() {\n return this._transition.hashCode() ^ this._offsetBefore.hashCode() ^ (this._offsetAfter.hashCode()>>>16);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a string describing this object.\n *\n * @return {string} a string for debugging, not null\n */\n toString() {\n return 'Transition[' + (this.isGap() ? 'Gap' : 'Overlap') +\n ' at ' + this._transition.toString() + this._offsetBefore.toString() +\n ' to ' + this._offsetAfter + ']';\n }\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 {ChronoField} from './ChronoField';\nimport {createTemporalQuery} from './TemporalQuery';\nimport {TemporalQueries} from './TemporalQueries';\n\nimport {LocalDate} from '../LocalDate';\nimport {LocalTime} from '../LocalTime';\nimport {ZoneOffset} from '../ZoneOffset';\n\n\nexport function _init() {\n //-----------------------------------------------------------------------\n /**\n * A strict query for the {@link ZoneId}.\n */\n TemporalQueries.ZONE_ID = createTemporalQuery('ZONE_ID', (temporal) => {\n return temporal.query(TemporalQueries.ZONE_ID);\n });\n\n /**\n * A query for the {@link Chronology}.\n */\n TemporalQueries.CHRONO = createTemporalQuery('CHRONO', (temporal) => {\n return temporal.query(TemporalQueries.CHRONO);\n });\n\n /**\n * A query for the smallest supported unit.\n */\n TemporalQueries.PRECISION = createTemporalQuery('PRECISION', (temporal) => {\n return temporal.query(TemporalQueries.PRECISION);\n });\n\n //-----------------------------------------------------------------------\n /**\n * A query for {@link ZoneOffset} returning null if not found.\n */\n TemporalQueries.OFFSET = createTemporalQuery('OFFSET', (temporal) => {\n if (temporal.isSupported(ChronoField.OFFSET_SECONDS)) {\n return ZoneOffset.ofTotalSeconds(temporal.get(ChronoField.OFFSET_SECONDS));\n }\n return null;\n });\n\n /**\n * A lenient query for the {@link ZoneId}, falling back to the {@link ZoneOffset}.\n */\n TemporalQueries.ZONE = createTemporalQuery('ZONE', (temporal) => {\n const zone = temporal.query(TemporalQueries.ZONE_ID);\n return (zone != null ? zone : temporal.query(TemporalQueries.OFFSET));\n });\n\n /**\n * A query for {@link LocalDate} returning null if not found.\n */\n TemporalQueries.LOCAL_DATE = createTemporalQuery('LOCAL_DATE', (temporal) => {\n if (temporal.isSupported(ChronoField.EPOCH_DAY)) {\n return LocalDate.ofEpochDay(temporal.getLong(ChronoField.EPOCH_DAY));\n }\n return null;\n });\n\n /**\n * A query for {@link LocalTime} returning null if not found.\n */\n TemporalQueries.LOCAL_TIME = createTemporalQuery('LOCAL_TIME', (temporal) => {\n if (temporal.isSupported(ChronoField.NANO_OF_DAY)) {\n return LocalTime.ofNanoOfDay(temporal.getLong(ChronoField.NANO_OF_DAY));\n }\n return null;\n });\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 {ZoneRules} from './ZoneRules';\nimport {ZoneOffset} from '../ZoneOffset';\nimport {DateTimeException} from '../errors';\n\nexport class SystemDefaultZoneRules extends ZoneRules {\n\n isFixedOffset(){\n return false;\n }\n\n /**\n *\n * @param {Instant} instant\n * @returns {ZoneOffset}\n */\n offsetOfInstant(instant){\n const offsetInMinutes = new Date(instant.toEpochMilli()).getTimezoneOffset();\n return ZoneOffset.ofTotalMinutes(offsetInMinutes * -1);\n }\n\n /**\n *\n * @param {number} epochMilli\n * @returns {ZoneOffset}\n */\n offsetOfEpochMilli(epochMilli){\n const offsetInMinutes = new Date(epochMilli).getTimezoneOffset();\n return ZoneOffset.ofTotalMinutes(offsetInMinutes * -1);\n }\n\n /**\n * This implementation is NOT returning the best value in a gap or overlap situation\n * as specified at {@link ZoneRules.offsetOfLocalDateTime}.\n *\n * The calculated offset depends Date.prototype.getTimezoneOffset and its not specified\n * at the ECMA-262 specification how to handle daylight savings gaps/ overlaps.\n *\n * The Chrome Browser version 49 is returning the next transition offset in a gap/overlap situation,\n * other browsers/ engines might do it in the same way.\n *\n * @param {LocalDateTime} localDateTime\n * @returns {ZoneOffset}\n */\n offsetOfLocalDateTime(localDateTime){\n const epochMilli = localDateTime.toEpochSecond(ZoneOffset.UTC) * 1000;\n const offsetInMinutesBeforePossibleTransition = new Date(epochMilli).getTimezoneOffset();\n const epochMilliSystemZone = epochMilli + offsetInMinutesBeforePossibleTransition * 60000;\n const offsetInMinutesAfterPossibleTransition = new Date(epochMilliSystemZone).getTimezoneOffset();\n return ZoneOffset.ofTotalMinutes(offsetInMinutesAfterPossibleTransition * -1);\n }\n\n /**\n *\n * @param localDateTime\n * @return {ZoneOffset[]}\n */\n validOffsets(localDateTime){\n return [this.offsetOfLocalDateTime(localDateTime)];\n }\n\n /**\n * @return null, not supported\n */\n transition(){\n return null;\n }\n\n /**\n *\n * @param instant\n * @return {ZoneOffset}\n */\n standardOffset(instant){\n return this.offsetOfInstant(instant);\n }\n\n /**\n * @throws DateTimeException not supported\n */\n daylightSavings(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n isDaylightSavings(){\n this._throwNotSupported();\n }\n\n /**\n *\n * @param {LocalDateTime} dateTime\n * @param {ZoneOffset} offset\n * @return {boolean}\n */\n isValidOffset(dateTime, offset) {\n return this.offsetOfLocalDateTime(dateTime).equals(offset);\n }\n\n /**\n * @throws DateTimeException not supported\n */\n nextTransition(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n previousTransition(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n transitions(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n transitionRules(){\n this._throwNotSupported();\n }\n\n /**\n * @throws DateTimeException not supported\n */\n _throwNotSupported(){\n throw new DateTimeException('not supported operation');\n }\n //-----------------------------------------------------------------------\n /**\n *\n * @param other\n * @returns {boolean}\n */\n equals(other) {\n if (this === other || other instanceof SystemDefaultZoneRules) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n *\n * @returns {string}\n */\n toString() {\n return 'SYSTEM';\n }\n\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 {SystemDefaultZoneRules} from './SystemDefaultZoneRules';\nimport {ZoneId} from '../ZoneId';\n\nexport class SystemDefaultZoneId extends ZoneId {\n\n constructor(){\n super();\n this._rules = new SystemDefaultZoneRules();\n }\n\n rules(){\n return this._rules;\n }\n\n equals(other){\n if(this === other){\n return true;\n }\n return false;\n }\n\n id(){\n return 'SYSTEM';\n }\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 {requireNonNull} from './assert';\nimport {DateTimeException, IllegalArgumentException} from './errors';\nimport {StringUtil} from './StringUtil';\n\nimport {ZoneOffset} from './ZoneOffset';\nimport {ZoneRegion} from './ZoneRegion';\nimport {ZoneId} from './ZoneId';\n\nimport {TemporalQueries} from './temporal/TemporalQueries';\nimport {SystemDefaultZoneId} from './zone/SystemDefaultZoneId';\nimport {ZoneRulesProvider} from './zone/ZoneRulesProvider';\n\n/**\n * @see {@link ZoneId}\n *\n * Helper class to avoid dependency cycles.\n * Static methods of the class ZoneIdFactory are added automatically to class ZoneId.\n * @private\n */\nexport class ZoneIdFactory {\n\n /**\n * Gets the system default time-zone.\n *\n *\n * @return {ZoneId} the zone ID, not null\n */\n static systemDefault() {\n return SYSTEM_DEFAULT_ZONE_ID_INSTANCE;\n }\n\n /**\n * Gets the set of available zone IDs.\n *\n * This set includes the string form of all available region-based IDs.\n * Offset-based zone IDs are not included in the returned set.\n * The ID can be passed to {@link of} to create a {@link ZoneId}.\n *\n * The set of zone IDs can increase over time, although in a typical application\n * the set of IDs is fixed. Each call to this method is thread-safe.\n *\n * @return {string[]} a modifiable copy of the set of zone IDs, not null\n */\n static getAvailableZoneIds() {\n return ZoneRulesProvider.getAvailableZoneIds();\n }\n\n /**\n * Obtains an instance of {@link ZoneId} from an ID ensuring that the\n * ID is valid and available for use.\n *\n * This method parses the ID producing a {@link ZoneId} or {@link ZoneOffset}.\n * A {@link ZoneOffset} is returned if the ID is 'Z', or starts with '+' or '-'.\n * The result will always be a valid ID for which {@link ZoneRules} can be obtained.\n *\n * Parsing matches the zone ID step by step as follows.\n *\n * * If the zone ID equals 'Z', the result is {@link ZoneOffset.UTC}.\n * * If the zone ID consists of a single letter, the zone ID is invalid\n * and {@link DateTimeException} is thrown.\n * * If the zone ID starts with '+' or '-', the ID is parsed as a\n * {@link ZoneOffset} using {@link ZoneOffset#of}.\n * * If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a {@link ZoneId}\n * with the same ID and rules equivalent to {@link ZoneOffset.UTC}.\n * * If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'\n * then the ID is a prefixed offset-based ID. The ID is split in two, with\n * a two or three letter prefix and a suffix starting with the sign.\n * The suffix is parsed as a {@link ZoneOffset}.\n * The result will be a {@link ZoneId} with the specified UTC/GMT/UT prefix\n * and the normalized offset ID as per {@link ZoneOffset#getId}.\n * The rules of the returned {@link ZoneId} will be equivalent to the\n * parsed {@link ZoneOffset}.\n * * All other IDs are parsed as region-based zone IDs. Region IDs must\n * match the regular expression `[A-Za-z][A-Za-z0-9~/._+-]+`,\n * otherwise a {@link DateTimeException} is thrown. If the zone ID is not\n * in the configured set of IDs, {@link ZoneRulesException} is thrown.\n * The detailed format of the region ID depends on the group supplying the data.\n * The default set of data is supplied by the IANA Time Zone Database (TZDB).\n * This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.\n * This is compatible with most IDs from {@link java.util.TimeZone}.\n *\n * @param {string} zoneId the time-zone ID, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if the zone ID has an invalid format\n * @throws ZoneRulesException if the zone ID is a region ID that cannot be found\n */\n static of(zoneId) {\n requireNonNull(zoneId, 'zoneId');\n if (zoneId === 'Z') {\n return ZoneOffset.UTC;\n }\n if (zoneId.length === 1) {\n throw new DateTimeException('Invalid zone: ' + zoneId);\n }\n if (StringUtil.startsWith(zoneId, '+') || StringUtil.startsWith(zoneId, '-')) {\n return ZoneOffset.of(zoneId);\n }\n if (zoneId === 'UTC' || zoneId === 'GMT' || zoneId === 'GMT0' || zoneId === 'UT') {\n return new ZoneRegion(zoneId, ZoneOffset.UTC.rules());\n }\n if (StringUtil.startsWith(zoneId, 'UTC+') || StringUtil.startsWith(zoneId, 'GMT+') ||\n StringUtil.startsWith(zoneId, 'UTC-') || StringUtil.startsWith(zoneId, 'GMT-')) {\n const offset = ZoneOffset.of(zoneId.substring(3));\n if (offset.totalSeconds() === 0) {\n return new ZoneRegion(zoneId.substring(0, 3), offset.rules());\n }\n return new ZoneRegion(zoneId.substring(0, 3) + offset.id(), offset.rules());\n }\n if (StringUtil.startsWith(zoneId, 'UT+') || StringUtil.startsWith(zoneId, 'UT-')) {\n const offset = ZoneOffset.of(zoneId.substring(2));\n if (offset.totalSeconds() === 0) {\n return new ZoneRegion('UT', offset.rules());\n }\n return new ZoneRegion('UT' + offset.id(), offset.rules());\n }\n // javascript special case\n if(zoneId === 'SYSTEM'){\n return ZoneId.systemDefault();\n }\n return ZoneRegion.ofId(zoneId);\n }\n\n /**\n * Obtains an instance of {@link ZoneId} wrapping an offset.\n *\n * If the prefix is 'GMT', 'UTC', or 'UT' a {@link ZoneId}\n * with the prefix and the non-zero offset is returned.\n * If the prefix is empty `''` the {@link ZoneOffset} is returned.\n *\n * @param {string} prefix the time-zone ID, not null\n * @param {ZoneOffset} offset the offset, not null\n * @return {ZoneId} the zone ID, not null\n * @throws IllegalArgumentException if the prefix is not one of\n * 'GMT', 'UTC', or 'UT', or ''\n */\n static ofOffset(prefix, offset) {\n requireNonNull(prefix, 'prefix');\n requireNonNull(offset, 'offset');\n if (prefix.length === 0) {\n return offset;\n }\n if (prefix === 'GMT' || prefix === 'UTC' || prefix === 'UT') {\n if (offset.totalSeconds() === 0) {\n return new ZoneRegion(prefix, offset.rules());\n }\n return new ZoneRegion(prefix + offset.id(), offset.rules());\n }\n throw new IllegalArgumentException('Invalid prefix, must be GMT, UTC or UT: ' + prefix);\n }\n\n\n /**\n * Obtains an instance of {@link ZoneId} from a temporal object.\n *\n * A {@link TemporalAccessor} represents some form of date and time information.\n * This factory converts the arbitrary temporal object to an instance of {@link ZoneId}.\n *\n * The conversion will try to obtain the zone in a way that favours region-based\n * zones over offset-based zones using {@link TemporalQueries#zone}.\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 ZoneId::from}.\n *\n * @param {!TemporalAccessor} temporal - the temporal object to convert, not null\n * @return {ZoneId} the zone ID, not null\n * @throws DateTimeException if unable to convert to a {@link ZoneId}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n const obj = temporal.query(TemporalQueries.zone());\n if (obj == null) {\n throw new DateTimeException('Unable to obtain ZoneId from TemporalAccessor: ' +\n temporal + ', type ' + (temporal.constructor != null ? temporal.constructor.name : ''));\n }\n return obj;\n }\n}\n\nlet SYSTEM_DEFAULT_ZONE_ID_INSTANCE = null;\n\nexport function _init(){\n SYSTEM_DEFAULT_ZONE_ID_INSTANCE = new SystemDefaultZoneId();\n\n // a bit magic to stay a bit more to the threeten bp impl.\n ZoneId.systemDefault = ZoneIdFactory.systemDefault;\n ZoneId.getAvailableZoneIds = ZoneIdFactory.getAvailableZoneIds;\n ZoneId.of = ZoneIdFactory.of;\n ZoneId.ofOffset = ZoneIdFactory.ofOffset;\n ZoneId.from = ZoneIdFactory.from;\n ZoneOffset.from = ZoneIdFactory.from;\n\n // short cut\n ZoneId.SYSTEM = SYSTEM_DEFAULT_ZONE_ID_INSTANCE;\n ZoneId.UTC = ZoneOffset.ofTotalSeconds(0);\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 ZoneOffsetInit} from './ZoneOffset';\nimport {_init as DayOfWeekInit} from './DayOfWeek';\nimport {_init as DurationInit} from './Duration';\nimport {_init as InstantInit} from './Instant';\nimport {_init as LocalDateInit} from './LocalDate';\nimport {_init as LocalTimeInit} from './LocalTime';\nimport {_init as LocalDateTimeInit} from './LocalDateTime';\nimport {_init as MonthInit} from './Month';\nimport {_init as MonthDayInit} from './MonthDay';\nimport {_init as PeriodInit} from './Period';\nimport {_init as YearInit} from './Year';\nimport {_init as YearConstantsInit} from './YearConstants';\nimport {_init as YearMonthInit} from './YearMonth';\nimport {_init as ZonedDateTimeInit} from './ZonedDateTime';\nimport {_init as IsoChronologyInit} from './chrono/IsoChronology';\nimport {_init as DateTimeFormatterInit} from './format/DateTimeFormatter';\nimport {_init as ChronoFieldInit} from './temporal/ChronoField';\nimport {_init as ChronoUnitInit} from './temporal/ChronoUnit';\nimport {_init as IsoFieldsInit} from './temporal/IsoFields';\nimport {_init as DateTimeFormatterBuilderInit} from './format/DateTimeFormatterBuilder';\n\nimport {_init as TemporalQueriesInit} from './temporal/TemporalQueriesFactory';\nimport {_init as ZoneIdInit} from './ZoneIdFactory';\n\nlet isInit = false;\n\nfunction init() {\n\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n YearConstantsInit();\n DurationInit();\n ChronoUnitInit();\n ChronoFieldInit();\n LocalTimeInit();\n IsoFieldsInit();\n TemporalQueriesInit();\n DayOfWeekInit();\n InstantInit();\n LocalDateInit();\n LocalDateTimeInit();\n YearInit();\n MonthInit();\n YearMonthInit();\n MonthDayInit();\n PeriodInit();\n ZoneOffsetInit();\n ZonedDateTimeInit();\n ZoneIdInit();\n IsoChronologyInit();\n DateTimeFormatterInit();\n DateTimeFormatterBuilderInit();\n}\n\ninit();\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 {IllegalArgumentException} from './errors';\n\nimport {LocalDate} from './LocalDate';\nimport {LocalDateTime} from './LocalDateTime';\nimport {ZonedDateTime} from './ZonedDateTime';\nimport {ZoneId} from './ZoneId';\n\nclass ToNativeJsConverter {\n /**\n * @param {!(LocalDate|LocalDateTime|ZonedDateTime)} temporal - a joda temporal instance\n * @param {ZoneId} [zone] - the zone of the temporal,\n * the default value for LocalDate and LocalDateTime is ZoneId.systemDefault().\n */\n constructor(temporal, zone){\n let zonedDateTime;\n\n if(temporal instanceof LocalDate) {\n zone = zone == null ? ZoneId.systemDefault() : zone;\n zonedDateTime = temporal.atStartOfDay(zone);\n } else if (temporal instanceof LocalDateTime) {\n zone = zone == null ? ZoneId.systemDefault() : zone;\n zonedDateTime = temporal.atZone(zone);\n } else if (temporal instanceof ZonedDateTime) {\n if (zone == null) {\n zonedDateTime = temporal;\n } else {\n zonedDateTime = temporal.withZoneSameInstant(zone);\n }\n } else {\n throw new IllegalArgumentException('unsupported instance for convert operation:' + temporal);\n }\n\n this.instant = zonedDateTime.toInstant();\n }\n\n /**\n *\n * @returns {Date}\n */\n toDate() {\n return new Date(this.instant.toEpochMilli());\n }\n\n /**\n *\n * @returns {number}\n */\n toEpochMilli() {\n return this.instant.toEpochMilli();\n }\n}\n\n/**\n * converts a LocalDate, LocalDateTime or ZonedDateTime to a native Javascript Date.\n *\n * In a first step the temporal is converted to an Instant by adding implicit values.\n * \n * A LocalDate is implicit set to a LocalDateTime at start of day. \n * A LocalDateTime is implicit set to a ZonedDateTime with \n * the passed zone or if null, with the system default time zone. \n * A ZonedDateTime is converted to an Instant, if a zone is specified the zonedDateTime is adjusted to this \n * zone, keeping the same Instant.\n *\n * In a second step the instant is converted to a native Javascript Date\n *\n * default zone for LocalDate and LocalDateTime is ZoneId.systemDefault().\n *\n * @example\n * convert(localDate).toDate() // returns a javascript Date\n * convert(localDate).toEpochMilli() // returns the epochMillis\n *\n * @param {!(LocalDate|LocalDateTime|ZonedDateTime)} temporal - a joda temporal instance\n * @param {ZoneId} [zone] - the zone of the temporal\n * @returns {ToNativeJsConverter}\n */\nexport function convert(temporal, zone){\n return new ToNativeJsConverter(temporal, zone);\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 {assert, requireNonNull} from '../assert';\nimport {UnsupportedTemporalTypeException} from '../errors';\n\nimport {Instant} from '../Instant';\nimport {LocalDate} from '../LocalDate';\nimport {LocalTime} from '../LocalTime';\nimport {MathUtil} from '../MathUtil';\nimport {ZoneId} from '../ZoneId';\n\nimport {ChronoField} from './ChronoField';\nimport {TemporalQueries} from './TemporalQueries';\nimport {TemporalAccessor} from './TemporalAccessor';\n\n/**\n * A wrapper around a native javascript Date instance that\n * implements TemporalAccessor functionality\n */\nclass NativeJsTemporal extends TemporalAccessor {\n\n /**\n * @param {!(Date|moment)} date - a javascript Date or a moment instance\n * @param {ZoneId} [zone=ZoneId.systemDefault()] - the zone of the temporal, defaults to ZoneId.systemDefault()\n * @private\n */\n constructor(date, zone=ZoneId.systemDefault()){\n super();\n this._zone = zone;\n if(date instanceof Date) {\n this._epochMilli = date.getTime();\n return;\n } else if(typeof date.toDate === 'function' && date.toDate() instanceof Date) {\n // it's a moment\n this._epochMilli = date.toDate().getTime();\n return;\n }\n assert(false, 'date must be either a javascript date or a moment');\n }\n\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\n */\n query(query) {\n requireNonNull(query, 'query');\n if (query === TemporalQueries.localDate()) {\n return LocalDate.ofInstant(Instant.ofEpochMilli(this._epochMilli), this._zone);\n } else if(query === TemporalQueries.localTime()){\n return LocalTime.ofInstant(Instant.ofEpochMilli(this._epochMilli), this._zone);\n } else if(query === TemporalQueries.zone()){\n return this._zone;\n }\n return super.query(query);\n }\n\n /**\n *\n * @param {TemporalField} field\n * @returns {number}\n */\n get(field) {\n return this.getLong(field);\n }\n\n /**\n *\n * @param {!TemporalField} field\n * @returns {number}\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field instanceof ChronoField) {\n switch (field) {\n case ChronoField.NANO_OF_SECOND: return MathUtil.floorMod(this._epochMilli, 1000) * 1000000;\n case ChronoField.INSTANT_SECONDS: return MathUtil.floorDiv(this._epochMilli, 1000);\n }\n throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);\n }\n return field.getFrom(this);\n }\n\n /**\n *\n * @param {TemporalField} field\n * @returns {boolean}\n */\n isSupported(field){\n return field === ChronoField.INSTANT_SECONDS || field === ChronoField.NANO_OF_SECOND;\n }\n}\n\n/**\n *\n * @param {!(Date|moment)} date - a javascript Date or a moment instance\n * @param {ZoneId} [zone=ZoneId.systemDefault()] - the zone of the temporal, defaults to ZoneId.systemDefault()\n * @returns {NativeJsTemporal}\n */\nexport function nativeJs(date, zone){\n return new NativeJsTemporal(date, zone);\n}\n","\nexport function bindUse(jsJoda) {\n const used = [];\n\n /**\n * use\n *\n * Provides a way to extend the internals of js-joda\n *\n * @param {function} fn - function to extend js-joda public api\n * @returns {this} for chaining\n */\n return function use(fn) {\n if (!~used.indexOf(fn)) {\n fn(jsJoda);\n used.push(fn);\n }\n return jsJoda;\n };\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 {\n ArithmeticException,\n DateTimeException,\n DateTimeParseException,\n IllegalArgumentException,\n IllegalStateException,\n UnsupportedTemporalTypeException,\n NullPointerException\n} from './errors';\n\nimport { Clock } from './Clock';\nimport { DayOfWeek } from './DayOfWeek';\nimport { Duration } from './Duration';\nimport { Instant } from './Instant';\nimport { LocalDate } from './LocalDate';\nimport { LocalTime } from './LocalTime';\nimport { LocalDateTime } from './LocalDateTime';\nimport { Month } from './Month';\nimport { MonthDay } from './MonthDay';\nimport { Period } from './Period';\nimport { Year } from './Year';\nimport { YearConstants } from './YearConstants';\nimport { YearMonth } from './YearMonth';\nimport { ZonedDateTime } from './ZonedDateTime';\nimport { ZoneOffset } from './ZoneOffset';\nimport { ZoneId } from './ZoneId';\nimport { ZoneRegion } from './ZoneRegion';\n\nimport { ZoneOffsetTransition } from './zone/ZoneOffsetTransition';\nimport { ZoneRules } from './zone/ZoneRules';\nimport { ZoneRulesProvider } from './zone/ZoneRulesProvider';\n\nimport { ChronoLocalDate } from './chrono/ChronoLocalDate';\nimport { ChronoLocalDateTime } from './chrono/ChronoLocalDateTime';\nimport { ChronoZonedDateTime } from './chrono/ChronoZonedDateTime';\nimport { IsoChronology } from './chrono/IsoChronology';\n\nimport { ChronoField } from './temporal/ChronoField';\nimport { ChronoUnit } from './temporal/ChronoUnit';\nimport { IsoFields } from './temporal/IsoFields';\nimport { Temporal } from './temporal/Temporal';\nimport { TemporalAccessor } from './temporal/TemporalAccessor';\nimport { TemporalAdjuster } from './temporal/TemporalAdjuster';\nimport { TemporalAdjusters } from './temporal/TemporalAdjusters';\nimport { TemporalAmount } from './temporal/TemporalAmount';\nimport { TemporalField } from './temporal/TemporalField';\nimport { TemporalQueries } from './temporal/TemporalQueries';\nimport { TemporalQuery } from './temporal/TemporalQuery';\nimport { TemporalUnit } from './temporal/TemporalUnit';\nimport { ValueRange } from './temporal/ValueRange';\n\nimport { DateTimeFormatter } from './format/DateTimeFormatter';\nimport { DateTimeFormatterBuilder } from './format/DateTimeFormatterBuilder';\nimport { DecimalStyle } from './format/DecimalStyle';\nimport { ResolverStyle } from './format/ResolverStyle';\nimport { SignStyle } from './format/SignStyle';\nimport { TextStyle } from './format/TextStyle';\n\n// init static properties\nimport './_init';\n\n// private/internal exports, e.g. for use in plugins\nimport { MathUtil } from './MathUtil';\nimport { StringUtil } from './StringUtil';\nimport { DateTimeBuilder } from './format/DateTimeBuilder';\nimport { DateTimeParseContext } from './format/DateTimeParseContext';\nimport { DateTimePrintContext } from './format/DateTimePrintContext';\nimport { StringBuilder } from './format/StringBuilder';\nimport * as assert from './assert';\n\nimport { convert } from './convert';\nimport { nativeJs } from './temporal/NativeJsTemporal';\nimport { bindUse } from './use';\n\nconst _ = {\n assert,\n DateTimeBuilder,\n DateTimeParseContext,\n DateTimePrintContext,\n MathUtil,\n StringUtil,\n StringBuilder,\n};\n\nconst jsJiodaExports = {\n _,\n convert,\n nativeJs,\n ArithmeticException,\n DateTimeException,\n DateTimeParseException,\n IllegalArgumentException,\n IllegalStateException,\n UnsupportedTemporalTypeException,\n NullPointerException,\n Clock,\n DayOfWeek,\n Duration,\n Instant,\n LocalDate,\n LocalTime,\n LocalDateTime,\n Month,\n MonthDay,\n Period,\n Year,\n YearConstants,\n YearMonth,\n ZonedDateTime,\n ZoneOffset,\n ZoneId,\n ZoneRegion,\n ZoneOffsetTransition,\n ZoneRules,\n ZoneRulesProvider,\n ChronoLocalDate,\n ChronoLocalDateTime,\n ChronoZonedDateTime,\n IsoChronology,\n ChronoField,\n ChronoUnit,\n IsoFields,\n Temporal,\n TemporalAccessor,\n TemporalAdjuster,\n TemporalAdjusters,\n TemporalAmount,\n TemporalField,\n TemporalQueries,\n TemporalQuery,\n TemporalUnit,\n ValueRange,\n DateTimeFormatter,\n DateTimeFormatterBuilder,\n DecimalStyle,\n ResolverStyle,\n SignStyle,\n TextStyle,\n};\n\nconst use = bindUse(jsJiodaExports);\njsJiodaExports.use = use;\n\nexport {\n _,\n use,\n convert,\n nativeJs,\n ArithmeticException,\n DateTimeException,\n DateTimeParseException,\n IllegalArgumentException,\n IllegalStateException,\n UnsupportedTemporalTypeException,\n NullPointerException,\n Clock,\n DayOfWeek,\n Duration,\n Instant,\n LocalDate,\n LocalTime,\n LocalDateTime,\n Month,\n MonthDay,\n Period,\n Year,\n YearConstants,\n YearMonth,\n ZonedDateTime,\n ZoneOffset,\n ZoneId,\n ZoneRegion,\n ZoneOffsetTransition,\n ZoneRules,\n ZoneRulesProvider,\n ChronoLocalDate,\n ChronoLocalDateTime,\n ChronoZonedDateTime,\n IsoChronology,\n ChronoField,\n ChronoUnit,\n IsoFields,\n Temporal,\n TemporalAccessor,\n TemporalAdjuster,\n TemporalAdjusters,\n TemporalAmount,\n TemporalField,\n TemporalQueries,\n TemporalQuery,\n TemporalUnit,\n ValueRange,\n DateTimeFormatter,\n DateTimeFormatterBuilder,\n DecimalStyle,\n ResolverStyle,\n SignStyle,\n TextStyle,\n};\n"],"names":["createErrorType","name","init","superErrorClass","Error","E","message","captureStackTrace","stack","constructor","apply","arguments","toString","prototype","DateTimeException","messageWithCause","DateTimeParseException","messageForDateTimeParseException","UnsupportedTemporalTypeException","ArithmeticException","IllegalArgumentException","IllegalStateException","NullPointerException","cause","msg","text","index","parsedString","errorIndex","assert","assertion","error","requireNonNull","value","parameterName","requireInstance","_class","abstractMethodFail","methodName","TypeError","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","MathUtil","intDiv","x","y","r","roundDown","safeZero","intMod","Math","ceil","floor","floorDiv","floorMod","safeAdd","verifyInt","safeToInt","safeSubtract","safeMultiply","parseInt","isNaN","compareNumbers","a","b","smi","int","hash","number","Infinity","result","hashCode","numbers","n","Enum","_name","equals","other","toJSON","TemporalAmount","get","unit","units","addTo","temporal","subtractFrom","TemporalUnit","duration","isDurationEstimated","isDateBased","isTimeBased","isSupportedBy","dateTime","periodToAdd","between","temporal1","temporal2","Duration","seconds","nanos","_seconds","_nanos","ofDays","days","_create","LocalTime","SECONDS_PER_DAY","ofHours","hours","SECONDS_PER_HOUR","ofMinutes","minutes","SECONDS_PER_MINUTE","ofSeconds","nanoAdjustment","secs","NANOS_PER_SECOND","nos","ofMillis","millis","mos","ofNanos","of","amount","ZERO","plus","from","forEach","startInclusive","endExclusive","until","ChronoUnit","SECONDS","isSupported","ChronoField","NANO_OF_SECOND","startNos","getLong","adjustedEnd","with","e","parse","PATTERN","RegExp","matches","exec","negate","dayMatch","hourMatch","minuteMatch","secondMatch","fractionMatch","daysAsSecs","_parseNumber","hoursAsSecs","minsAsSecs","negativeSecs","charAt","_parseFraction","ex","parsed","multiplier","errorText","substring","parseFloat","length","_createSecondsNanos","_createNegateDaysHoursMinutesSecondsNanos","negated","NANOS","isZero","isNegative","nano","withSeconds","withNanos","nanoOfSecond","checkValidIntValue","plusDuration","durationOrNumber","unitOrNumber","plusAmountUnit","plusSecondsNanos","amountToAdd","DAYS","plusNanos","MICROS","MILLIS","plusMillis","plusSeconds","multipliedBy","plusDays","daysToAdd","plusHours","hoursToAdd","plusMinutes","minutesToAdd","secondsToAdd","millisToAdd","nanosToAdd","epochSec","minus","minusDuration","minusAmountUnit","secsToSubtract","nanosToSubtract","amountToSubtract","minusDays","daysToSubtract","minusHours","hoursToSubtract","minusMinutes","minutesToSubtract","minusSeconds","secondsToSubtract","minusMillis","millisToSubtract","minusNanos","multiplicand","dividedBy","divisor","secsMod","abs","toDays","toHours","toMinutes","toMillis","round","toNanos","totalNanos","compareTo","otherDuration","cmp","rval","nanoString","slice","_init","YearConstants","MIN_VALUE","MAX_VALUE","estimatedDuration","_duration","FOREVER","e2","MINUTES","HOURS","HALF_DAYS","WEEKS","MONTHS","YEARS","DECADES","CENTURIES","MILLENNIA","ERAS","TemporalField","ValueRange","minSmallest","minLargest","maxSmallest","maxLargest","_minSmallest","_minLargest","_maxLargest","_maxSmallest","isFixed","minimum","largestMinimum","maximum","smallestMaximum","isValidValue","checkValidValue","field","isValidIntValue","isIntValue","str","byName","fieldName","prop","hasOwnProperty","baseUnit","rangeUnit","range","_baseUnit","_rangeUnit","_range","displayName","dateBased","DAY_OF_WEEK","ALIGNED_DAY_OF_WEEK_IN_MONTH","ALIGNED_DAY_OF_WEEK_IN_YEAR","DAY_OF_MONTH","DAY_OF_YEAR","EPOCH_DAY","ALIGNED_WEEK_OF_MONTH","ALIGNED_WEEK_OF_YEAR","MONTH_OF_YEAR","YEAR_OF_ERA","YEAR","ERA","timeBased","NANO_OF_DAY","MICRO_OF_SECOND","MICRO_OF_DAY","MILLI_OF_SECOND","MILLI_OF_DAY","SECOND_OF_MINUTE","SECOND_OF_DAY","MINUTE_OF_HOUR","MINUTE_OF_DAY","HOUR_OF_AMPM","CLOCK_HOUR_OF_AMPM","HOUR_OF_DAY","CLOCK_HOUR_OF_DAY","AMPM_OF_DAY","rangeRefinedBy","getFrom","PROLEPTIC_MONTH","INSTANT_SECONDS","OFFSET_SECONDS","TemporalQueries","zoneId","ZONE_ID","chronology","CHRONO","precision","PRECISION","zone","ZONE","offset","OFFSET","localDate","LOCAL_DATE","localTime","LOCAL_TIME","TemporalAccessor","query","queryFrom","Temporal","TemporalQuery","createTemporalQuery","queryFromFunction","ExtendedTemporalQuery","DayOfWeek","ordinal","_ordinal","values","ENUMS","valueOf","dayOfWeek","getDisplayName","style","locale","adjustInto","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY","FROM","StringUtil","startsWith","pattern","indexOf","len","i","chr","charCodeAt","ZoneId","systemDefault","getAvailableZoneIds","ofOffset","prefix","id","rules","normalized","isFixedOffset","Instant","EPOCH","ZoneRules","Fixed","instantOrLocalDateTime","offsetOfInstant","offsetOfLocalDateTime","instant","offsetOfEpochMilli","epochMilli","localDateTime","validOffsets","transition","standardOffset","daylightSavings","isDaylightSavings","isValidOffset","nextTransition","previousTransition","transitions","transitionRules","_offset","SECONDS_CACHE","ID_CACHE","ZoneOffset","totalSeconds","_validateTotalSeconds","_totalSeconds","_rules","_id","_buildId","absTotalSeconds","absHours","absMinutes","MINUTES_PER_HOUR","buf","absSeconds","MAX_SECONDS","_validate","offsetId","first","ofHoursMinutesSeconds","pos","precededByColon","ch1","ch2","ofHoursMinutes","ofTotalSeconds","ofTotalMinutes","totalMinutes","totalSecs","obj","UTC","MIN","MAX","Period","years","months","_years","_months","_days","ofYears","create","ofMonths","ofWeeks","weeks","unitAmount","startDate","endDate","LocalDate","_parse","yearMatch","monthMatch","weekMatch","val","IsoChronology","INSTANCE","withYears","withMonths","withDays","plusYears","yearsToAdd","plusMonths","monthsToAdd","minusYears","yearsToSubtract","minusMonths","monthsToSubtract","scalar","totalMonths","toTotalMonths","splitYears","splitMonths","ParsePosition","_index","_errorIndex","getIndex","setIndex","getErrorIndex","setErrorIndex","EnumMap","_map","putAll","otherMap","key","containsKey","undefined","put","set","retainAll","keyList","map","remove","keyName","keySet","clear","ResolverStyle","STRICT","SMART","LENIENT","DateTimeBuilder","dtb","_addFieldValue","fieldValues","chrono","date","time","leapSecond","excessDays","getFieldValue0","old","_putFieldValue0","resolve","resolverStyle","resolverFields","_mergeDate","_mergeTime","_resolveTimeInferZeroes","_resolveInstant","_checkDate","resolveDate","_addObject","val1","val2","ch","ap","hap","nod","cod","lod","sod","mod","los","cos","hod","moh","som","hodVal","mohVal","somVal","nosVal","ofNanoOfDay","ofSecondOfDay","dateOrTime","ChronoLocalDate","offsetSecs","atTime","atZone","build","type","DateTimeParseContext","_constructorSelf","_constructorFormatter","_constructorParam","_caseSensitive","_strict","_parsed","Parsed","symbols","_locale","_symbols","_overrideChronology","formatter","decimalStyle","_overrideZone","copy","isStrict","setStrict","strict","setLocale","startOptional","push","currentParsed","endOptional","successful","splice","isCaseSensitive","setCaseSensitive","caseSensitive","subSequenceEquals","cs1","offset1","cs2","offset2","toLowerCase","charEquals","charEqualsIgnoreCase","c1","c2","setParsedField","errorPos","successPos","currentParsedFieldValues","setParsedZone","getParsed","toParsed","setParsedLeapSecond","getEffectiveChronology","dateTimeParseContext","cloned","toBuilder","builder","overrideZone","DateTimePrintContext","localeOrFormatter","DateTimeFormatter","_temporal","adjust","_optional","getValueQuery","getValue","setDateTime","SignStyle","positive","fixedWidth","NORMAL","ALWAYS","EXCEEDS_PAD","NEVER","NOT_NEGATIVE","StringBuilder","_str","append","appendChar","insert","replace","start","end","setLength","parsedExcessDays","PARSED_EXCESS_DAYS","parsedLeapSecond","PARSED_LEAP_SECOND","ofPattern","DateTimeFormatterBuilder","appendPattern","toFormatter","printerParser","_printerParser","_decimalStyle","_resolverStyle","_resolverFields","_chrono","_zone","withChronology","withLocale","withResolverStyle","format","_formatTo","appendable","context","print","parse1","parse2","_parseToBuilder","_createError","abbr","position","_parseUnresolved0","substr","parseUnresolved","_toPrinterParser","optional","withOptional","ISO_LOCAL_DATE","appendValue","appendLiteral","ISO_LOCAL_TIME","optionalStart","appendFraction","ISO_LOCAL_DATE_TIME","parseCaseInsensitive","ISO_INSTANT","appendInstant","ISO_OFFSET_DATE_TIME","appendOffsetId","ISO_ZONED_DATE_TIME","parseCaseSensitive","appendZoneId","fieldOrUnit","ofEpochDay","toEpochDay","IsoFields","QUARTER_DAYS","Field","_isIso","_getWeekRangeByLocalDate","wby","_getWeekBasedYear","_getWeekRangeByYear","isLeapYear","_getWeek","dow0","doy0","dayOfYear","doyThu0","alignedWeek","firstThuDoy0","firstMonDoy0","withDayOfYear","week","year","doy","dow","DAY_OF_QUARTER_FIELD","QUARTER_YEARS","qoy","QUARTER_OF_YEAR","moy","newValue","curValue","partialTemporal","yearLong","qoyLong","doq","DAY_OF_QUARTER","max","QUARTER_OF_YEAR_FIELD","WEEK_OF_WEEK_BASED_YEAR_FIELD","WEEK_BASED_YEARS","wbyLong","WEEK_BASED_YEAR","dowLong","wowby","WEEK_OF_WEEK_BASED_YEAR","plusWeeks","temp","WEEK_BASED_YEAR_FIELD","newWby","resolved","Unit","added","isoWeekOfWeekyear","isoWeekyear","DecimalStyle","zeroChar","positiveSignChar","negativeSignChar","decimalPointChar","_zeroDigit","_zeroDigitCharCode","_positiveSign","_negativeSign","_decimalSeparator","positiveSign","withPositiveSign","negativeSign","withNegativeSign","zeroDigit","withZeroDigit","decimalSeparator","withDecimalSeparator","convertToDigit","char","convertNumberToI18N","numericText","diff","convertedText","String","fromCharCode","availableLocales","STANDARD","TextStyle","isStandalone","FULL_STANDALONE","SHORT_STANDALONE","NARROW_STANDALONE","asStandalone","FULL","SHORT","NARROW","asNormal","CharLiteralPrinterParser","literal","_literal","CompositePrinterParser","printerParsers","_printerParsers","pp","FractionPrinterParser","minWidth","maxWidth","decimalPoint","fraction","convertToFraction","outputScale","min","effectiveMin","effectiveMax","minEndPos","maxEndPos","total","digit","moveLeft","scale","pow","convertFromFraction","_min","_value","_scaled","decimal","MAX_WIDTH","EXCEED_POINTS","NumberPrinterParser","signStyle","subsequentWidth","_field","_minWidth","_maxWidth","_signStyle","_subsequentWidth","withFixedWidth","withSubsequentWidth","_isFixedWidth","contextValue","_getValue","sign","negative","effMinWidth","effMaxWidth","pass","parseLen","_setValue","ReducedPrinterParser","width","baseValue","baseDate","_baseValue","_baseDate","absValue","lastPart","basePart","isFixedWidth","PATTERNS","OffsetIdPrinterParser","noOffsetText","_checkPattern","bufPos","output","noOffsetLen","array","arrayIndex","parseText","required","converted","INSTANCE_ID","PadPrinterParserDecorator","padWidth","padChar","_padWidth","_padChar","preLen","endPos","resultPos","SettingsParser","SENSITIVE","INSENSITIVE","StringLiteralPrinterParser","ZoneRulesProvider","getRules","ZoneRegion","ofId","ZoneIdPrinterParser","description","nextChar","newContext","nextNextChar","_parsePrefixedOffset","availableZoneIds","zoneIdTree","size","ZoneIdTree","createTreeMap","maxParseLength","treeMap","parsedZoneId","parseLength","parsedSubZoneId","isLeaf","prefixPos","toUpperCase","sortedZoneIds","sort","ZoneIdTreeMap","add","_treeMap","idLength","subZoneId","subTreeMap","_active","_parent","_padNextWidth","_padNextChar","_valueParserIndex","_of","parent","dtFormatterBuilder","_appendInternalPrinterParser","parseStrict","parseLenient","_appendValue1","_appendValue2","_appendValue4","_appendValuePrinterParser","appendValueReduced","_appendValueReducedFieldWidthMaxWidthBaseDate","_appendValueReducedFieldWidthMaxWidthBaseValue","activeValueParser","basePP","_appendInternal","fractionalDigits","InstantPrinterParser","appendOffset","_parsePattern","appendZoneText","appendText","appendLocalizedOffset","appendWeekField","FIELD_MAP","cur","count","pad","padNext","_parseField","zero","optionalEnd","BASE_DATE","_padNext1","_padNext2","cpp","SECONDS_PER_10000_YEARS","SECONDS_0000_TO_1970","inSecs","inNanos","inSec","inNano","zeroSecs","hi","lo","ldt","LocalDateTime","ofEpochSecond","second","div","minDigits","maxDigits","parser","yearParsed","month","day","hour","secVal","nanoVal","sec","instantSecs","toEpochSecond","Month","newMonthVal","leapYear","FEBRUARY","APRIL","JUNE","SEPTEMBER","NOVEMBER","minLength","maxLength","firstDayOfYear","leap","JANUARY","MARCH","MAY","JULY","AUGUST","OCTOBER","DECEMBER","firstMonthOfQuarter","MonthDay","now","zoneIdOrClock","now0","nowZoneId","nowClock","Clock","systemDefaultZone","system","clock","dayOfMonth","monthOrNumber","ofMonthNumber","ofNumberNumber","parseString","parseStringFormatter","PARSER","_month","_day","monthValue","isValidYear","Year","isLeap","withMonth","withDayOfMonth","atYear","isAfter","isBefore","YearMonth","ofNumberMonth","_year","isSupportedField","isSupportedUnit","_getProlepticMonth","isValidDay","lengthOfMonth","lengthOfYear","adjusterOrFieldOrNumber","withAdjuster","withFieldValue","withYearMonth","newYear","newMonth","adjuster","f","withYear","amountOrNumber","plusAmount","monthCount","calcMonths","minusAmount","monthsUntil","atDay","atEndOfMonth","isoYear","parseTextFormatter","plusAmountToAddUnit","minusAmountToSubtractUnit","isValidMonthDay","monthDay","ofYearDay","atMonth","atMonthMonth","atMonthNumber","atMonthDay","otherYear","TemporalAdjuster","TemporalAdjusters","firstDayOfMonth","Impl","FIRST_DAY_OF_MONTH","lastDayOfMonth","LAST_DAY_OF_MONTH","firstDayOfNextMonth","FIRST_DAY_OF_NEXT_MONTH","FIRST_DAY_OF_YEAR","lastDayOfYear","LAST_DAY_OF_YEAR","firstDayOfNextYear","FIRST_DAY_OF_NEXT_YEAR","firstInMonth","DayOfWeekInMonth","lastInMonth","dayOfWeekInMonth","next","RelativeDayOfWeek","nextOrSame","previous","previousOrSame","_dowValue","curDow","dowDiff","daysDiff","relative","_relative","calDow","prolepticYear","_updateResolveMap","current","prolepticMonth","yoeLong","era","dom","aw","ad","ChronoZonedDateTime","toLocalDate","toLocalTime","toInstant","epochDay","toSecondOfDay","toLocalDateTime","strcmp","thisEpochSec","otherEpochSec","isEqual","ZonedDateTime","clockOrZone","ofInstant","of2","of3","of8","ofLocal","minute","dt","preferredOffset","trans","offsetAfter","some","validOffset","ofInstant2","ofInstant3","epochSecond","ofStrict","isGap","ofLenient","zdt","_from","__from","_dateTime","_resolveLocal","newDateTime","_resolveOffset","withEarlierOffsetAtOverlap","isOverlap","earlierOffset","offsetBefore","withLaterOffsetAtOverlap","laterOffset","withZoneSameLocal","withZoneSameInstant","withFixedOffsetZone","withTemporalAdjuster","with2","withHour","withMinute","withSecond","withNano","truncatedTo","plusTemporalAmount","plus2","minusTemporalAmount","minus2","minusWeeks","difference","DAYS_PER_CYCLE","DAYS_0000_TO_1970","monthEnd","adjustCycles","doyEst","yearEst","zeroDay","marchDoy0","marchMonth0","_resolvePreviousValid","_get0","_prolepticMonth","fieldOrAdjuster","withFieldAndValue","m","p1","p2","plus1","weeksToAdd","mjDay","minus1","weeksToSubtract","until1","until2","daysUntil","_monthsUntil","packed1","packed2","calcDate","atTime1","atTime4","atStartOfDay","atStartOfDayWithZone","MIDNIGHT","dateTimeAfter","_compareTo0","otherDate","yearValue","dayValue","dayString","monthString","yearString","absYear","EPOCH_0","ChronoLocalDateTime","toNanoOfDay","_now","_ofEpochMillis","localSecond","localEpochDay","secsOfDay","ofDateAndTime","ofNumbers","_date","_time","_withDateTime","newDate","newTime","adjusterOrField","MICROS_PER_DAY","MILLIS_PER_DAY","_plusWithOverflow","totDays","NANOS_PER_DAY","MINUTES_PER_DAY","HOURS_PER_DAY","totNanos","NANOS_PER_MINUTE","NANOS_PER_HOUR","curNoD","newNoD","timeUntil","endTime","secondOfDay","nanoOfDay","_hour","_minute","_second","_nanoOfSecond","_nano","ham","unitDur","dur","newHour","mofd","newMofd","newMinute","secondstoAdd","sofd","newSofd","newSecond","nofd","newNofd","newNano","nanosUntil","atDate","hourValue","minuteValue","secondValue","nanoValue","NOON","NANOS_PER_MILLI","systemUTC","ofEpochMilli","MIN_SECONDS","nval","_plus","_nanosUntil","toEpochMilli","_secondsUntil","secsDiff","nanosDiff","otherInstant","SystemClock","fixed","fixedInstant","FixedClock","baseClock","OffsetClock","withZone","Date","getTime","_instant","_zoneId","_baseClock","ZoneOffsetTransition","_transition","_offsetBefore","_offsetAfter","dateTimeBefore","durationSeconds","d","SystemDefaultZoneRules","offsetInMinutes","getTimezoneOffset","offsetInMinutesBeforePossibleTransition","epochMilliSystemZone","offsetInMinutesAfterPossibleTransition","_throwNotSupported","SystemDefaultZoneId","ZoneIdFactory","SYSTEM_DEFAULT_ZONE_ID_INSTANCE","SYSTEM","isInit","YearConstantsInit","DurationInit","ChronoUnitInit","ChronoFieldInit","LocalTimeInit","IsoFieldsInit","TemporalQueriesInit","DayOfWeekInit","InstantInit","LocalDateInit","LocalDateTimeInit","YearInit","MonthInit","YearMonthInit","MonthDayInit","PeriodInit","ZoneOffsetInit","ZonedDateTimeInit","ZoneIdInit","IsoChronologyInit","DateTimeFormatterInit","DateTimeFormatterBuilderInit","ToNativeJsConverter","zonedDateTime","toDate","convert","NativeJsTemporal","_epochMilli","nativeJs","bindUse","jsJoda","used","use","fn","_","jsJiodaExports"],"mappings":";;;;;;;;;;;IAAA;;;;;IAKA,SAASA,eAAT,CAAyBC,IAAzB,EAA+BC,IAA/B,EAA8D;IAAA,QAAzBC,eAAyB,uEAAPC,KAAO;;IAC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