@js-joda/extra 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js-joda-extra.esm.js +379 -3
- package/dist/js-joda-extra.esm.js.map +1 -1
- package/dist/js-joda-extra.js +619 -241
- package/dist/js-joda-extra.js.map +1 -1
- package/dist/js-joda-extra.min.js +2 -2
- package/package.json +3 -3
- package/src/DayOfMonth.js +487 -0
- package/src/DayOfYear.js +472 -0
- package/src/_init.js +4 -0
- package/src/js-joda-extra.js +4 -0
- package/src/plug.js +4 -0
- package/typings/js-joda-extra.d.ts +46 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"js-joda-extra.js","sources":["../src/assert.js","../src/Interval.js","../src/_init.js","../src/plug.js","../src/js-joda-extra.js"],"sourcesContent":["/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @returns {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @returns {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * <p>\n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * <p>\n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * <p>\n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n *\n * if called without arguments, then {@link Interval.ofInstantInstant} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n *\n * Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {!(Instant)} startInstant\n * @param {!(Instant|Duration)} endInstantOrDuration\n * @returns {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and end instant.\n * <p>\n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws DateTimeException if the end is before the start\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and a duration.\n * <p>\n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive the start instant, inclusive, not null\n * @param {Duration} duration the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws DateTimeException if the end is before the start,\n * or if the duration addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs when adding the duration\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of {@code Interval} from a text string such as\n * {@code 2007-12-03T10:15:30Z/2007-12-04T10:15:30Z}, where the end instant is exclusive.\n * <p>\n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * <li>a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * <li>a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n * </ul>\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive the start instant, inclusive, validated not null\n * @param {Instant} endExclusive the end instant, exclusive, validated not null\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * <p>\n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * <p>\n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * <p>\n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws DateTimeException if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws DateTimeException if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * <p>\n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then {@code contains(Instant#MIN)} returns true.\n * If this range has an unbounded end then {@code contains(Instant#MAX)} returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * <p>\n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * <p>\n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * <p>\n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * <p>\n * This is equivalent to {@code (overlaps(other) || abuts(other))}.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * <p>\n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * <p>\n * This is equivalent to {@code (isConnected(other) && !abuts(other))}.\n *\n * @param {Interval} other the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * <p>\n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * <p>\n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * <p>\n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Interval#isAfter}\n *\n * if called with an Instant, then {@link Interval#isAfterInstant} is executed.\n *\n * Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * function overloading for {@link Interval#isBefore}\n *\n * if called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n *\n * Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * <p>\n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * <p>\n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * <p>\n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * <p>\n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * <p>\n * An {@code Interval} is associated with two specific instants on the time-line.\n * A {@code Duration} is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * <p>\n * Compares this {@code Interval} with another ensuring that the two instants are the same.\n * Only objects of type {@code Interval} are compared, other types return false.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a {@code String}, such as {@code 2007-12-03T10:15:30/2007-12-04T10:15:30}.\n * <p>\n * The output will be the ISO-8601 format formed by combining the\n * {@code toString()} methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as intervalInit } from './Interval';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n intervalInit();\n}\n\ninit();\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { Interval } from './Interval';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.Interval = Interval;\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { Interval } from './Interval';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n Interval,\n};\n"],"names":["requireNonNull","value","parameterName","NullPointerException","requireInstance","_class","IllegalArgumentException","name","constructor","Interval","of","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","Instant","isBefore","DateTimeException","duration","isNegative","plus","parse","text","i","length","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","equals","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","compareTo","encloses","other","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","obj","hashCode","toString","_init","ALL","isInit","init","intervalInit","use","plug"],"mappings":";;;;;;;;;;;IAAA;IACA;IACA;IACA;IA4BO,SAASA,cAAT,CAAwBC,KAAxB,EAA+BC,aAA/B,EAA8C;IACjD,MAAID,KAAK,IAAI,IAAb,EAAmB;IACf,UAAM,IAAIE,yBAAJ,CAA4BD,aAA5B,uBAAN;IACH;;IACD,SAAOD,KAAP;IACH;IAUM,SAASG,eAAT,CAAyBH,KAAzB,EAAgCI,MAAhC,EAAwCH,aAAxC,EAAuD;IAC1D,MAAI,EAAED,KAAK,YAAYI,MAAnB,CAAJ,EAAgC;IAC5B,UAAM,IAAIC,6BAAJ,CAAgCJ,aAAhC,iCAAwEG,MAAM,CAACE,IAAP,GAAcF,MAAM,CAACE,IAArB,GAA4BF,MAApG,KAA6GJ,KAAK,IAAIA,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ACR;IACH;;IAEDA,EAAAA,MAAM,GAAG,IAAT;IAEAE,EAAAA,KAAY;IACf;;IAEDD,IAAI;;ICnBJ;IACA;IACA;IACA;IAWe,iBAAwB;;ICdvC;IACA;IACA;IACA;AAOAE,YAAG,CAACC,IAAD,CAAH;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"js-joda-extra.js","sources":["../src/assert.js","../src/DayOfMonth.js","../src/DayOfYear.js","../src/Interval.js","../src/_init.js","../src/plug.js","../src/js-joda-extra.js"],"sourcesContent":["/**\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\nimport { NullPointerException, IllegalArgumentException } from '@js-joda/core';\n\n/**\n * @private\n *\n * @param assertion\n * @param msg\n * @param error\n */\nexport function assert(assertion, msg, error) {\n if (!assertion) {\n if (error) {\n // eslint-disable-next-line new-cap\n throw new error(msg);\n } else {\n throw new Error(msg);\n }\n }\n}\n\n/**\n * @private\n *\n * @param value\n * @param parameterName\n * @returns {*}\n */\nexport function requireNonNull(value, parameterName) {\n if (value == null) {\n throw new NullPointerException(`${parameterName} must not be null`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param value\n * @param _class\n * @param parameterName\n * @returns {_class}\n */\nexport function requireInstance(value, _class, parameterName) {\n if (!(value instanceof _class)) {\n throw new IllegalArgumentException(`${parameterName} must be an instance of ${_class.name ? _class.name : _class}${value && value.constructor && value.constructor.name ? `, but is ${value.constructor.name}` : ''}`);\n }\n return value;\n}\n\n/**\n * @private\n *\n * @param methodName\n */\nexport function abstractMethodFail(methodName) {\n throw new TypeError(`abstract method \"${methodName}\" is not implemented`);\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, Clock, DateTimeException, IllegalArgumentException, IsoChronology, LocalDate, Month, MonthDay, TemporalAccessor, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A day-of-month in the ISO-8601 calendar system.\n * \n * {@link DayOfMonth} is an immutable date-time object that represents a day-of-month.\n * It is a type-safe way of representing a day-of-month in an application.\n * Any field that can be derived from a day-of-month can be obtained.\n * \n * This class does not store or represent a year, month, time or time-zone.\n * For example, the value '21' can be stored in a {@link DayOfMonth} and\n * would represent the 21st day of any month.\n */\nexport class DayOfMonth extends TemporalAccessor {\n //-----------------------------------------------------------------------\n /**\n * Function overloading for {@link DayOfMonth.now}:\n * * if called with no arguments, {@link DayOfMonth.now0} is executed;\n * * if called with an instance of {@link ZoneId}, then {@link DayOfMonth.nowZoneId} is executed;\n * * if called with an instance of {@link Clock}, then {@link DayOfMonth.nowClock} is executed;\n * * otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @returns {DayOfMonth}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return DayOfMonth.now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return DayOfMonth.nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return DayOfMonth.nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n /**\n * Obtains the current day-of-month from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current day-of-month.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return the current day-of-month using the system clock and default time-zone, not null\n * @private\n */\n static now0() {\n return this.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current day-of-month from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock#system(java.time.ZoneId) system clock} to obtain the current day-of-month.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param zone the zone ID to use, not null\n * @return the current day-of-month using the system clock, not null\n * @private\n */\n static nowZoneId(zone) {\n return this.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current day-of-month from the specified clock.\n * \n * This will query the specified clock to obtain the current day-of-month.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock dependency injection}.\n *\n * @param clock the clock to use, not null\n * @return the current day-of-month, not null\n * @private\n */\n static nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return DayOfMonth.of(now.dayOfMonth());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfMonth}.\n * \n * A day-of-month object represents one of the 31 days of the month, from 1 to 31.\n *\n * @param dayOfMonth the day-of-month to represent, from 1 to 31\n * @return the day-of-month, not null\n * @throws DateTimeException if the day-of-month is invalid\n */\n static of(dayOfMonth) {\n if (1 <= dayOfMonth && dayOfMonth <= 31) {\n return DayOfMonth.VALUES[dayOfMonth - 1];\n } else {\n throw new DateTimeException(`Invalid value for DayOfMonth: ${dayOfMonth}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfMonth} from a date-time object.\n * \n * This obtains a day-of-month based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link DayOfMonth}.\n * \n * The conversion extracts the {@link ChronoField#DAY_OF_MONTH} day-of-month field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link DayOfMonth.from}.\n *\n * @param temporal the temporal object to convert, not null\n * @return the day-of-month, not null\n * @throws {DateTimeException} if unable to convert to a {@link DayOfMonth}\n */\n static from(temporal) {\n if (temporal instanceof DayOfMonth) {\n return temporal;\n }\n requireNonNull(temporal, 'temporal');\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return DayOfMonth.of(temporal.get(ChronoField.DAY_OF_MONTH));\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain DayOfMonth from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param dayOfMonth the day-of-month to represent, from 1 to 31.\n * @private\n */\n constructor(dayOfMonth) {\n super();\n this._day = MathUtil.safeToInt(dayOfMonth);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the day-of-month value.\n *\n * @return the day-of-month, from 1 to 31\n */\n value() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this day-of-month can be queried for the specified field.\n * If false, then calling the {@link DayOfMonth.range} range,\n * {@link DayOfMonth.get} get and {@link DayOfMonth.getLong} getLong\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * <ul>\n * <li>{@link ChronoField.DAY_OF_MONTH}\n * </ul>\n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param field the field to check, null returns false\n * @return true if the field is supported on this day-of-month, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_MONTH;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-month is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param field the field to query the range for, not null\n * @return the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_MONTH) {\n return field.range();\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-month as an `int`.\n * \n * This queries this day-of-month for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported} supported fields will return valid\n * values based on this day-of-month.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param 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 or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-month as a {@link long}.\n * \n * This queries this day-of-month for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfMonth.isSupported(TemporalField) supported fields} will return valid\n * values based on this day-of-month.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param 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 UnsupportedTemporalTypeException if the field is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_MONTH) {\n return this._day;\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year-month is valid for this year.\n * \n * This method checks whether this day and the input year and month form\n * a valid date.\n *\n * @param yearMonth the year month to validate, null returns false\n * @return true if the year and month are valid for this day\n */\n isValidYearMonth(yearMonth) {\n return yearMonth != null && yearMonth.isValidDay(this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-month using the specified query.\n * \n * This queries this day-of-month using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param query the query to invoke, not null\n * @return the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-month.\n * \n * This returns a temporal object of the same observable type as the input\n * with the day-of-month changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.DAY_OF_MONTH} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisDay.adjustInto(temporal);\n * temporal = temporal.with(thisDay);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param temporal 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 requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException('Adjustment only supported on ISO date-time');\n }*/\n return temporal.with(ChronoField.DAY_OF_MONTH, this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this day-of-month with a month to create a {@link MonthDay}.\n * \n * This returns a {@link MonthDay} formed from this day and the specified month.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = day.atMonth(month).atYear(year);\n * ```\n * \n * If this day-of-month is invalid for the month then it will be changed\n * to the last valid date for the month.\n *\n * @param month the month-of-year to use, from 1 (January) to 12 (December), not null\n * @return the year-month formed from this year and the specified month, not null\n */\n atMonth(month) {\n requireNonNull(month, 'month');\n if (month instanceof Month) {\n return MonthDay.of(month, Math.min(this._day, month.maxLength()));\n } else {\n return MonthDay.of(month, Math.min(this._day, Month.of(month).maxLength()));\n }\n }\n\n /**\n * Combines this day-of-month with a year-month to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this year and the specified year-month.\n * \n * If this day-of-month is invalid for the year-month then it will be changed\n * to the last valid date for the month.\n *\n * @param yearMonth the year-month to use, not null\n * @return the local date formed from this year and the specified year-month, not null\n */\n atYearMonth(yearMonth) {\n requireNonNull(yearMonth, 'yearMonth');\n return yearMonth.atDay(Math.min(this._day, yearMonth.lengthOfMonth()));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this day-of-month to another.\n * \n * The comparison is based on the value of the day.\n * It is 'consistent with equals', as defined by {@link Comparable}.\n *\n * @param other the other day-of-month instance, not null\n * @return the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfMonth, 'other');\n return this._day - other._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this day-of-month is equal to another day-of-month.\n *\n * @param obj the other day-of-month instance, null returns false\n * @return true if the day-of-month is the same\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof DayOfMonth) {\n return this._day === obj._day;\n }\n return false;\n }\n\n /**\n * A hash code for this day-of-month.\n *\n * @return a suitable hash code\n */\n hashCode() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this day-of-month as a {@link String}.\n *\n * @return a string representation of this day-of-month, not null\n */\n toString() {\n return `DayOfMonth:${this._day}`;\n }\n\n}\n\nexport function _init() {\n /**\n * Cache of singleton instances.\n */\n DayOfMonth.VALUES = new Array(31);\n for (let i = 0; i < 31; i++) {\n DayOfMonth.VALUES[i] = new DayOfMonth(i + 1);\n }\n}\n","/*\n * @copyright (c) 2022, Philipp Thürwächter & Pattrick Hüper & Michał Sobkiewicz\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { ChronoField, Clock, DateTimeException, IllegalArgumentException, IsoChronology, LocalDate, TemporalAccessor, TemporalQueries, TemporalQuery, UnsupportedTemporalTypeException, Year, ZoneId } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireInstance, requireNonNull } from './assert';\nimport { _ as jodaInternal } from '@js-joda/core';\n\nconst MathUtil = jodaInternal.MathUtil;\n\n/**\n * A day-of-year in the ISO-8601 calendar system.\n * \n * {@link DayOfYear} is an immutable date-time object that represents a day-of-year.\n * It is a type-safe way of representing a day-of-year in an application.\n * Any field that can be derived from a day-of-year can be obtained.\n * \n * This class does not store or represent a year, month, time or time-zone.\n * For example, the value \"51\" can be stored in a {@link DayOfYear} and\n * would represent the 51st day of any year.\n */\nexport class DayOfYear extends TemporalAccessor {\n /**\n * Function overloading for {@link DayOfYear.now}:\n * * if called with no arguments, {@link DayOfYear.now0} is executed;\n * * if called with an instance of {@link ZoneId}, then {@link DayOfYear.nowZoneId} is executed;\n * * if called with an instance of {@link Clock}, then {@link DayOfYear.nowClock} is executed;\n * * otherwise {@link IllegalArgumentException} is thrown.\n * \n * @param {?(ZoneId|Clock)} zoneIdOrClock\n * @returns {DayOfYear}\n */\n static now(zoneIdOrClock) {\n switch (arguments.length) {\n case 0:\n return DayOfYear.now0();\n case 1:\n requireNonNull(zoneIdOrClock, 'clockOrZone');\n if (zoneIdOrClock instanceof ZoneId) {\n return DayOfYear.nowZoneId(zoneIdOrClock);\n }\n if (zoneIdOrClock instanceof Clock) {\n return DayOfYear.nowClock(zoneIdOrClock);\n }\n throw new IllegalArgumentException(`zoneIdOrClock must be an instance of ZoneId or Clock, but is ${zoneIdOrClock.constructor.name}`);\n default:\n throw new IllegalArgumentException(`Invalid number of arguments: ${arguments.length}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current day-of-year from the system clock in the default time-zone.\n * \n * This will query the {@link Clock.systemDefaultZone} system clock in the default\n * time-zone to obtain the current day-of-year.\n * The zone and offset will be set based on the time-zone in the clock.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return the current day-of-year using the system clock and default time-zone, not null\n * @private\n */\n static now0() {\n return DayOfYear.now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current day-of-year from the system clock in the specified time-zone.\n * \n * This will query the {@link Clock.system} system clock to obtain the current day-of-year.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * \n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param zone the zone ID to use, not null\n * @return the current day-of-year using the system clock, not null\n * @private\n */\n static nowZoneId(zone) {\n return DayOfYear.now(Clock.system(zone));\n }\n\n /**\n * Obtains the current day-of-year from the specified clock.\n * \n * This will query the specified clock to obtain the current day-of-year.\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock} dependency injection.\n *\n * @param clock the clock to use, not null\n * @return the current day-of-year, not null\n * @private\n */\n static nowClock(clock) {\n const now = LocalDate.now(clock); // called once\n return DayOfYear.of(now.dayOfYear());\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfYear}.\n * \n * A day-of-year object represents one of the 366 days of the year, from 1 to 366.\n *\n * @param dayOfYear the day-of-year to represent, from 1 to 366\n * @return the day-of-year, not null\n * @throws {DateTimeException} if the day-of-year is invalid\n */\n static of(dayOfYear) {\n if (1 <= dayOfYear && dayOfYear <= 366) {\n return DayOfYear.VALUES[dayOfYear - 1];\n } else {\n throw new DateTimeException(`Invalid value for DayOfYear: ${dayOfYear}`);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@link DayOfYear} from a date-time object.\n * \n * This obtains a day-of-year based on the specified temporal.\n * A {@link TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@link DayOfYear}.\n * \n * The conversion extracts the {@link ChronoField.DAY_OF_YEAR} day-of-year field.\n * The extraction is only permitted if the temporal object has an ISO\n * chronology, or can be converted to a {@link LocalDate}.\n * \n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used in queries via method reference, {@link DayOfYear.from}.\n *\n * @param temporal the temporal object to convert, not null\n * @return the day-of-year, not null\n * @throws {DateTimeException} if unable to convert to a {@link DayOfYear}\n */\n static from(temporal) {\n requireNonNull(temporal, 'temporal');\n requireInstance(temporal, TemporalAccessor, 'temporal');\n if (temporal instanceof DayOfYear) {\n return temporal;\n }\n try {\n /* TODO: only IsoChronology for now\n if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {\n temporal = LocalDate.from(temporal);\n }*/\n return DayOfYear.of(temporal.get(ChronoField.DAY_OF_YEAR));\n } catch (ex) {\n throw new DateTimeException(`Unable to obtain DayOfYear from TemporalAccessor: ${temporal} of type ${temporal.constructor.name}`, ex);\n }\n }\n\n \n //-----------------------------------------------------------------------\n /**\n * Constructor, previously validated.\n *\n * @param {number} dayOfYear the day-of-year being represented, from 1 to 366.\n * @private\n */\n constructor(dayOfYear) {\n super();\n this._day = MathUtil.safeToInt(dayOfYear);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the day-of-year value.\n *\n * @return the day-of-year, from 1 to 366\n */\n value() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n * \n * This checks if this day-of-year can be queried for the specified field.\n * If false, then calling the {@link DayOfYear.range} range,\n * {@link DayOfYear.get} get and {@link DayOfYear.getLong} getLong\n * methods will throw an exception.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n * \n * * {@link ChronoField.DAY_OF_YEAR}\n * \n * All other {@link ChronoField} instances will return false.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.isSupportedBy}\n * passing this as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param field the field to check, null returns false\n * @return true if the field is supported on this day-of-year, false if not\n */\n isSupported(field) {\n if (field instanceof ChronoField) {\n return field === ChronoField.DAY_OF_YEAR;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n * \n * The range object expresses the minimum and maximum valid values for a field.\n * This day-of-year is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return\n * appropriate range instances.\n * All other {@code ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.rangeRefinedBy}\n * passing this as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param field the field to query the range for, not null\n * @return the range of valid values for the field, not null\n * @throws {DateTimeException} if the range for the field cannot be obtained\n * @throws {UnsupportedTemporalTypeException} if the field is not supported\n */\n range(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_YEAR) {\n return field.range();\n }\n return super.range(field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-year as an `int`.\n * \n * This queries this day-of-year for the value for the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return valid\n * values based on this day-of-year.\n * All other {@link ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param 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 or\n * the value is outside the range of valid values for the field\n * @throws {UnsupportedTemporalTypeException} if the field is not supported or\n * the range of values exceeds an `int`\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n get(field) {\n return this.range(field).checkValidIntValue(this.getLong(field), field);\n }\n\n /**\n * Gets the value of the specified field from this day-of-year as a `long`.\n * \n * This queries this day-of-year for the value for the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n * \n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link DayOfYear.isSupported} supported fields will return valid\n * values based on this day-of-year.\n * All other {@code ChronoField} instances will throw an {@link UnsupportedTemporalTypeException}.\n * \n * If the field is not a {@link ChronoField}, then the result of this method\n * is obtained by invoking {@link TemporalField.getFrom}\n * passing this as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param 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 {UnsupportedTemporalTypeException} if the field is not supported\n * @throws {ArithmeticException} if numeric overflow occurs\n */\n getLong(field) {\n requireNonNull(field, 'field');\n if (field === ChronoField.DAY_OF_YEAR) {\n return this._day;\n } else if (field instanceof ChronoField) {\n throw new UnsupportedTemporalTypeException(`Unsupported field: ${field}`);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the year is valid for this day-of-year.\n * \n * This method checks whether this day-of-yearand the input year form\n * a valid date. This can only return false for day-of-year 366.\n *\n * @param year the year to validate\n * @return true if the year is valid for this day-of-year\n */\n isValidYear(year) {\n return (this._day < 366 || Year.isLeap(year));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this day-of-year using the specified query.\n * \n * This queries this day-of-year using the specified query strategy object.\n * The {@link TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n * \n * The result of this method is obtained by invoking the\n * {@link TemporalQuery.queryFrom} method on the\n * specified query passing this as the argument.\n *\n * @param query the query to invoke, not null\n * @return the query result, null may be returned (defined by the query)\n * @throws {DateTimeException} if unable to query (defined by the query)\n * @throws {ArithmeticException} if numeric overflow occurs (defined by the query)\n */\n query(query) {\n requireNonNull(query, 'query');\n requireInstance(query, TemporalQuery, 'query');\n if (query === TemporalQueries.chronology()) {\n return IsoChronology.INSTANCE;\n }\n return super.query(query);\n }\n\n /**\n * Adjusts the specified temporal object to have this day-of-year.\n * \n * This returns a temporal object of the same observable type as the input\n * with the day-of-year changed to be the same as this.\n * \n * The adjustment is equivalent to using {@link Temporal.with}\n * passing {@link ChronoField.DAY_OF_YEAR} as the field.\n * If the specified temporal object does not use the ISO calendar system then\n * a {@link DateTimeException} is thrown.\n * \n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal.with}:\n * ```\n * // these two lines are equivalent, but the second approach is recommended\n * temporal = thisDay.adjustInto(temporal);\n * temporal = temporal.with(thisDay);\n * ```\n * \n * This instance is immutable and unaffected by this method call.\n *\n * @param temporal 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 requireNonNull(temporal, 'temporal');\n /* TODO: only IsoChronology for now\n if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) === false) {\n throw new DateTimeException(\"Adjustment only supported on ISO date-time\");\n }*/\n return temporal.with(ChronoField.DAY_OF_YEAR, this._day);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this day-of-year with a year to create a {@link LocalDate}.\n * \n * This returns a {@link LocalDate} formed from this day and the specified year.\n * \n * This method can be used as part of a chain to produce a date:\n * ```\n * LocalDate date = day.atYear(year);\n * ```\n * \n * The day-of-year value 366 is only valid in a leap year.\n *\n * @param year the year to use ({@link Year} or `int`), not null\n * @return the local date formed from this day and the specified year, not null\n * @throws {DateTimeException} if the year is invalid or this is day 366 and the year is not a leap year\n */\n atYear(year) {\n requireNonNull(year, 'year');\n if (year instanceof Year) {\n return year.atDay(this._day);\n } else {\n return LocalDate.ofYearDay(year, this._day);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this day-of-year to another.\n * \n * The comparison is based on the value of the day.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *\n * @param other the other day-of-year instance, not null\n * @return the comparator value, negative if less, positive if greater\n */\n compareTo(other) {\n requireNonNull(other, 'other');\n requireInstance(other, DayOfYear, 'other');\n return this._day - other._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this day-of-year is equal to another day-of-year.\n *\n * @param obj the other day-of-year instance, null returns false\n * @return true if the day-of-year is the same\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof DayOfYear) {\n return this._day === obj._day;\n }\n return false;\n }\n\n /**\n * A hash code for this day-of-year.\n *\n * @return a suitable hash code\n */\n hashCode() {\n return this._day;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this day-of-year as a {@link String}.\n *\n * @return a string representation of this day-of-year, not null\n */\n toString() {\n return `DayOfYear:${this._day}`;\n }\n}\n\nexport function _init() {\n /**\n * Cache of singleton instances.\n */\n DayOfYear.VALUES = new Array(366);\n for (let i = 0; i < 366; i++) {\n DayOfYear.VALUES[i] = new DayOfYear(i + 1);\n }\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { DateTimeException, DateTimeParseException, Duration, IllegalArgumentException, Instant, ZonedDateTime } from '@js-joda/core';\n\n// TODO: hm... is this a good idea?? copied from joda currently, could we add a js-joda-utils module??\nimport { requireNonNull, requireInstance } from './assert';\n\n/**\n * An immutable interval of time between two instants.\n * <p>\n * An interval represents the time on the time-line between two {@link Instant}s.\n * The class stores the start and end instants, with the start inclusive and the end exclusive.\n * The end instant is always greater than or equal to the start instant.\n * <p>\n * The {@link Duration} of an interval can be obtained, but is a separate concept.\n * An interval is connected to the time-line, whereas a duration is not.\n * <p>\n * Intervals are not comparable. To compare the length of two intervals, it is\n * generally recommended to compare their durations.\n *\n */\nexport class Interval {\n //-----------------------------------------------------------------------\n /**\n * function overloading for {@link Interval.of}\n *\n * if called without arguments, then {@link Interval.ofInstantInstant} is executed.\n\n * if called with 1 arguments and first argument is an instance of ZoneId, then {@link Interval.ofInstantDuration} is executed.\n *\n * Otherwise {@link Interval.ofInstantDuration} is executed.\n *\n * @param {!(Instant)} startInstant\n * @param {!(Instant|Duration)} endInstantOrDuration\n * @returns {Interval}\n */\n static of(startInstant, endInstantOrDuration) {\n if (endInstantOrDuration instanceof Duration) {\n return Interval.ofInstantDuration(startInstant, endInstantOrDuration);\n } else {\n return Interval.ofInstantInstant(startInstant, endInstantOrDuration);\n }\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and end instant.\n * <p>\n * The end instant must not be before the start instant.\n *\n * @param {Instant} startInclusive the start instant, inclusive, MIN_DATE treated as unbounded, not null\n * @param {Instant} endExclusive the end instant, exclusive, MAX_DATE treated as unbounded, not null\n * @return {Interval} the half-open interval, not null\n * @throws DateTimeException if the end is before the start\n */\n static ofInstantInstant(startInclusive, endExclusive) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(endExclusive, 'endExclusive');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(endExclusive, Instant, 'endExclusive');\n if (endExclusive.isBefore(startInclusive)) {\n throw new DateTimeException('End instant must on or after start instant');\n }\n return new Interval(startInclusive, endExclusive);\n }\n\n /**\n * Obtains an instance of {@code Interval} from the start and a duration.\n * <p>\n * The end instant is calculated as the start plus the duration.\n * The duration must not be negative.\n *\n * @param {Instant} startInclusive the start instant, inclusive, not null\n * @param {Duration} duration the duration from the start to the end, not null\n * @return {Interval} the interval, not null\n * @throws DateTimeException if the end is before the start,\n * or if the duration addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs when adding the duration\n */\n static ofInstantDuration(startInclusive, duration) {\n requireNonNull(startInclusive, 'startInclusive');\n requireNonNull(duration, 'duration');\n requireInstance(startInclusive, Instant, 'startInclusive');\n requireInstance(duration, Duration, 'duration');\n if (duration.isNegative()) {\n throw new DateTimeException('Duration must not be zero or negative');\n }\n return new Interval(startInclusive, startInclusive.plus(duration));\n }\n\n //-----------------------------------------------------------------------\n\n /**\n * Obtains an instance of {@code Interval} from a text string such as\n * {@code 2007-12-03T10:15:30Z/2007-12-04T10:15:30Z}, where the end instant is exclusive.\n * <p>\n * The string must consist of one of the following three formats:\n * <ul>\n * <li>a representations of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link ZonedDateTime}\n * <li>a representation of an {@link ZonedDateTime}, followed by a forward slash,\n * followed by a representation of a {@link Duration}\n * <li>a representation of a {@link Duration}, followed by a forward slash,\n * followed by a representation of an {@link ZonedDateTime}\n * </ul>\n *\n * NOTE: in contrast to the threeten-extra base we are not using `OffsetDateTime` but `ZonedDateTime` to parse\n * the string, this does not change the format but adds the possibility to optionally specify a zone\n *\n * @param {string} text the text to parse, not null\n * @return {Interval} the parsed interval, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n static parse(text) {\n requireNonNull(text, 'text');\n if (!(typeof text === 'string')) {\n throw new IllegalArgumentException(`text must be a string, but is ${text.constructor.name}`);\n }\n for (let i = 0; i < text.length; i += 1) {\n if (text.charAt(i) === '/') {\n const firstChar = text.charAt(0);\n if (firstChar === 'P' || firstChar === 'p') {\n // duration followed by instant\n const duration = Duration.parse(text.substring(0, i));\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(end.minus(duration), end);\n } else {\n // instant followed by instant or duration\n const start = ZonedDateTime.parse(text.substring(0, i)).toInstant();\n if (i + 1 < text.length) {\n const c = text.charAt(i + 1);\n if (c === 'P' || c === 'p') {\n const duration = Duration.parse(text.substring(i + 1, text.length));\n return Interval.of(start, start.plus(duration));\n }\n }\n const end = ZonedDateTime.parse(text.substring(i + 1, text.length)).toInstant();\n return Interval.of(start, end);\n }\n }\n }\n throw new DateTimeParseException('Interval cannot be parsed, no forward slash found', text, 0);\n }\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param {Instant} startInclusive the start instant, inclusive, validated not null\n * @param {Instant} endExclusive the end instant, exclusive, validated not null\n */\n constructor(startInclusive, endExclusive) {\n this._start = startInclusive;\n this._end = endExclusive;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the start of this time interval, inclusive.\n * <p>\n * This will return {@link Instant#MIN} if the range is unbounded at the start.\n * In this case, the range includes all dates into the far-past.\n *\n * @return {Instant} the start of the time interval\n */\n start() {\n return this._start;\n }\n\n /**\n * Gets the end of this time interval, exclusive.\n * <p>\n * This will return {@link Instant#MAX} if the range is unbounded at the end.\n * In this case, the range includes all dates into the far-future.\n *\n * @return {Instant} the end of the time interval, exclusive\n */\n end() {\n return this._end;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the range is empty.\n * <p>\n * An empty range occurs when the start date equals the inclusive end date.\n *\n * @return {boolean} true if the range is empty\n */\n isEmpty() {\n return this._start.equals(this._end);\n }\n\n /**\n * Checks if the start of the interval is unbounded.\n *\n * @return {boolean} true if start is unbounded\n */\n isUnboundedStart() {\n return this._start.equals(Instant.MIN);\n }\n\n /**\n * Checks if the end of the interval is unbounded.\n *\n * @return {boolean} true if end is unbounded\n */\n isUnboundedEnd() {\n return this._end.equals(Instant.MAX);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this range with the specified start instant.\n *\n * @param {Instant} start the start instant for the new interval, not null\n * @return {Interval} an interval with the end from this interval and the specified start\n * @throws DateTimeException if the resulting interval has end before start\n */\n withStart(start) {\n return Interval.of(start, this._end);\n }\n\n /**\n * Returns a copy of this range with the specified end instant.\n *\n * @param {Instant} end the end instant for the new interval, not null\n * @return {Interval} an interval with the start from this interval and the specified end\n * @throws DateTimeException if the resulting interval has end before start\n */\n withEnd(end) {\n return Interval.of(this._start, end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval contains the specified instant.\n * <p>\n * This checks if the specified instant is within the bounds of this interval.\n * If this range has an unbounded start then {@code contains(Instant#MIN)} returns true.\n * If this range has an unbounded end then {@code contains(Instant#MAX)} returns true.\n * If this range is empty then this method always returns false.\n *\n * @param {Instant} instant the instant, not null\n * @return {boolean} true if this interval contains the instant\n */\n contains(instant) {\n requireNonNull(instant, 'instant');\n requireInstance(instant, Instant, 'instant');\n return this._start.compareTo(instant) <= 0 && (instant.compareTo(this._end) < 0 || this.isUnboundedEnd());\n }\n\n /**\n * Checks if this interval encloses the specified interval.\n * <p>\n * This checks if the bounds of the specified interval are within the bounds of this interval.\n * An empty interval encloses itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval contains the other interval\n */\n encloses(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this._start.compareTo(other.start()) <= 0 && other.end().compareTo(this._end) <= 0;\n }\n\n /**\n * Checks if this interval abuts the specified interval.\n * <p>\n * The result is true if the end of this interval is the start of the other, or vice versa.\n * An empty interval does not abut itself.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval abuts the other interval\n */\n abuts(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return !this._end.equals(other.start()) !== !this._start.equals(other.end());\n }\n\n /**\n * Checks if this interval is connected to the specified interval.\n * <p>\n * The result is true if the two intervals have an enclosed interval in common, even if that interval is empty.\n * An empty interval is connected to itself.\n * <p>\n * This is equivalent to {@code (overlaps(other) || abuts(other))}.\n *\n * @param {Interval} other the other interval, not null\n * @return {boolean} true if this interval is connected to the other interval\n */\n isConnected(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return this.equals(other) || (this._start.compareTo(other.end()) <= 0 && other.start().compareTo(this._end) <= 0);\n }\n\n /**\n * Checks if this interval overlaps the specified interval.\n * <p>\n * The result is true if the the two intervals share some part of the time-line.\n * An empty interval overlaps itself.\n * <p>\n * This is equivalent to {@code (isConnected(other) && !abuts(other))}.\n *\n * @param {Interval} other the time interval to compare to, null means a zero length interval now\n * @return {boolean} true if the time intervals overlap\n */\n overlaps(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n return other.equals(this) || (this._start.compareTo(other.end()) < 0 && other.start().compareTo(this._end) < 0);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Calculates the interval that is the intersection of this interval and the specified interval.\n * <p>\n * This finds the intersection of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the intersection of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n intersection(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return this;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return other;\n } else {\n const newStart = (cmpStart >= 0 ? this._start : other.start());\n const newEnd = (cmpEnd <= 0 ? this._end : other.end());\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the interval that is the union of this interval and the specified interval.\n * <p>\n * This finds the union of two intervals.\n * This throws an exception if the two intervals are not {@linkplain #isConnected(Interval) connected}.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that is the union of the two intervals\n * @throws DateTimeException if the intervals do not connect\n */\n union(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n if (this.isConnected(other) === false) {\n throw new DateTimeException(`Intervals do not connect: ${this} and ${other}`);\n }\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n if (cmpStart >= 0 && cmpEnd <= 0) {\n return other;\n } else if (cmpStart <= 0 && cmpEnd >= 0) {\n return this;\n } else {\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n }\n\n /**\n * Calculates the smallest interval that encloses this interval and the specified interval.\n * <p>\n * The result of this method will {@linkplain #encloses(Interval) enclose}\n * this interval and the specified interval.\n *\n * @param {Interval} other the other interval to check for, not null\n * @return {Interval} the interval that spans the two intervals\n */\n span(other) {\n requireNonNull(other, 'other');\n requireInstance(other, Interval, 'other');\n const cmpStart = this._start.compareTo(other.start());\n const cmpEnd = this._end.compareTo(other.end());\n const newStart = (cmpStart >= 0 ? other.start() : this._start);\n const newEnd = (cmpEnd <= 0 ? other.end() : this._end);\n return Interval.of(newStart, newEnd);\n }\n\n //-------------------------------------------------------------------------\n /**\n * function overloading for {@link Interval#isAfter}\n *\n * if called with an Instant, then {@link Interval#isAfterInstant} is executed.\n *\n * Otherwise {@link Interval#isAfterInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isAfter(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isAfterInstant(instantOrInterval);\n } else {\n return this.isAfterInterval(instantOrInterval);\n }\n }\n\n /**\n * function overloading for {@link Interval#isBefore}\n *\n * if called with an Instant, then {@link Interval#isBeforeInstant} is executed.\n *\n * Otherwise {@link Interval#isBeforeInterval} is executed.\n *\n * @param {!(Instant|Interval)} instantOrInterval\n * @returns {boolean}\n */\n isBefore(instantOrInterval) {\n if (instantOrInterval instanceof Instant) {\n return this.isBeforeInstant(instantOrInterval);\n } else {\n return this.isBeforeInterval(instantOrInterval);\n }\n }\n\n /**\n * Checks if this interval is after the specified instant.\n * <p>\n * The result is true if the this instant starts after the specified instant.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is after the specified instant\n */\n isAfterInstant(instant) {\n return this._start.compareTo(instant) > 0;\n }\n\n /**\n * Checks if this interval is before the specified instant.\n * <p>\n * The result is true if the this instant ends before the specified instant.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Instant} instant the other instant to compare to, not null\n * @return {boolean} true if the start of this interval is before the specified instant\n */\n isBeforeInstant(instant) {\n return this._end.compareTo(instant) <= 0 && this._start.compareTo(instant) < 0;\n }\n\n //-------------------------------------------------------------------------\n /**\n * Checks if this interval is after the specified interval.\n * <p>\n * The result is true if the this instant starts after the end of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * instant equals the end of the interval.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is after the specified instant\n */\n isAfterInterval(interval) {\n return this._start.compareTo(interval.end()) >= 0 && !interval.equals(this);\n }\n\n /**\n * Checks if this interval is before the specified interval.\n * <p>\n * The result is true if the this instant ends before the start of the specified interval.\n * Since intervals do not include their end points, this will return true if the\n * two intervals abut.\n * An empty interval behaves as though it is an instant for comparison purposes.\n *\n * @param {Interval} interval the other interval to compare to, not null\n * @return {boolean} true if this instant is before the specified instant\n */\n isBeforeInterval(interval) {\n return this._end.compareTo(interval.start()) <= 0 && !interval.equals(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the duration of this interval.\n * <p>\n * An {@code Interval} is associated with two specific instants on the time-line.\n * A {@code Duration} is simply an amount of time, separate from the time-line.\n *\n * @return {Duration} the duration of the time interval\n * @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}\n */\n toDuration() {\n return Duration.between(this._start, this._end);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this interval is equal to another interval.\n * <p>\n * Compares this {@code Interval} with another ensuring that the two instants are the same.\n * Only objects of type {@code Interval} are compared, other types return false.\n *\n * @param {*} obj the object to check, null returns false\n * @return {boolean} true if this is equal to the other interval\n */\n equals(obj) {\n if (this === obj) {\n return true;\n }\n if (obj instanceof Interval) {\n return this._start.equals(obj.start()) && this._end.equals(obj.end());\n }\n return false;\n }\n\n /**\n * A hash code for this interval.\n *\n * @return {number} a suitable hash code\n */\n hashCode() {\n // eslint-disable-next-line no-bitwise\n return this._start.hashCode() ^ this._end.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this interval as a {@code String}, such as {@code 2007-12-03T10:15:30/2007-12-04T10:15:30}.\n * <p>\n * The output will be the ISO-8601 format formed by combining the\n * {@code toString()} methods of the two instants, separated by a forward slash.\n *\n * @return {string} a string representation of this instant, not null\n */\n toString() {\n return `${this._start.toString()}/${this._end.toString()}`;\n }\n}\n\nexport function _init() {\n Interval.ALL = Interval.of(Instant.MIN, Instant.MAX);\n}\n","/*\n * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper\n * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)\n */\n\nimport { _init as dayOfMonthInit } from './DayOfMonth';\nimport { _init as dayOfYearInit } from './DayOfYear';\nimport { _init as intervalInit } from './Interval';\n\nlet isInit = false;\n\nfunction init() {\n if (isInit) {\n return;\n }\n\n isInit = true;\n\n dayOfMonthInit();\n dayOfYearInit();\n intervalInit();\n}\n\ninit();\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\n// import { DayOfMonth } from './DayOfMonth';\n// import { DayOfYear } from './DayOfYear';\n// import { Interval } from './Interval';\n\nimport './_init';\n\n/**\n * @private\n *\n * plugin Function, call using js-jodas use()\n */\nexport default function (/* jsJoda */) {\n // assign new prop to jsJoda context is useless, because it lives only in the local context\n // jsJoda.DayOfMonth = DayOfMonth;\n // jsJoda.DayOfYear = DayOfYear;\n // jsJoda.Interval = Interval;\n}\n","/*\n * @copyright (c) 2016, Philipp Thuerwaechter & Pattrick Hueper\n * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)\n */\n\nimport { use } from '@js-joda/core';\n\nimport { DayOfMonth } from './DayOfMonth';\nimport { DayOfYear } from './DayOfYear';\nimport { Interval } from './Interval';\nimport plug from './plug';\n\nuse(plug);\n\nexport {\n DayOfMonth,\n DayOfYear,\n Interval,\n};\n"],"names":["requireNonNull","value","parameterName","NullPointerException","requireInstance","_class","IllegalArgumentException","name","constructor","MathUtil","jodaInternal","DayOfMonth","now","zoneIdOrClock","arguments","length","now0","ZoneId","nowZoneId","Clock","nowClock","systemDefaultZone","zone","system","clock","LocalDate","of","dayOfMonth","VALUES","DateTimeException","from","temporal","get","ChronoField","DAY_OF_MONTH","ex","_day","safeToInt","isSupported","field","isSupportedBy","range","checkValidIntValue","getLong","UnsupportedTemporalTypeException","getFrom","isValidYearMonth","yearMonth","isValidDay","query","TemporalQuery","TemporalQueries","chronology","IsoChronology","INSTANCE","adjustInto","with","atMonth","month","Month","MonthDay","Math","min","maxLength","atYearMonth","atDay","lengthOfMonth","compareTo","other","equals","obj","hashCode","toString","TemporalAccessor","_init","Array","i","DayOfYear","dayOfYear","DAY_OF_YEAR","isValidYear","year","Year","isLeap","atYear","ofYearDay","Interval","startInstant","endInstantOrDuration","Duration","ofInstantDuration","ofInstantInstant","startInclusive","endExclusive","Instant","isBefore","duration","isNegative","plus","parse","text","charAt","firstChar","substring","end","ZonedDateTime","toInstant","minus","start","c","DateTimeParseException","_start","_end","isEmpty","isUnboundedStart","MIN","isUnboundedEnd","MAX","withStart","withEnd","contains","instant","encloses","abuts","isConnected","overlaps","intersection","cmpStart","cmpEnd","newStart","newEnd","union","span","isAfter","instantOrInterval","isAfterInstant","isAfterInterval","isBeforeInstant","isBeforeInterval","interval","toDuration","between","ALL","isInit","init","dayOfMonthInit","dayOfYearInit","intervalInit","use","plug"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EA4BO,SAASA,cAAT,CAAwBC,KAAxB,EAA+BC,aAA/B,EAA8C;EACjD,MAAID,KAAK,IAAI,IAAb,EAAmB;EACf,UAAM,IAAIE,yBAAJ,CAA4BD,aAA5B,uBAAN;EACH;;EACD,SAAOD,KAAP;EACH;EAUM,SAASG,eAAT,CAAyBH,KAAzB,EAAgCI,MAAhC,EAAwCH,aAAxC,EAAuD;EAC1D,MAAI,EAAED,KAAK,YAAYI,MAAnB,CAAJ,EAAgC;EAC5B,UAAM,IAAIC,6BAAJ,CAAgCJ,aAAhC,iCAAwEG,MAAM,CAACE,IAAP,GAAcF,MAAM,CAACE,IAArB,GAA4BF,MAApG,KAA6GJ,KAAK,IAAIA,KAAK,CAACO,WAAf,IAA8BP,KAAK,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AP;EACH;;EACD,QAAIA,GAAG,YAAYgB,QAAnB,EAA6B;EACzB,aAAO,KAAKyB,MAAL,CAAY1C,MAAZ,CAAmBC,GAAG,CAACsC,KAAJ,EAAnB,KAAmC,KAAKI,IAAL,CAAU3C,MAAV,CAAiBC,GAAG,CAACkC,GAAJ,EAAjB,CAA1C;EACH;;EACD,WAAO,KAAP;EACH,GAnfL;;EAAA,SA0fIjC,QA1fJ,GA0fI,oBAAW;EAEP,WAAO,KAAKwC,MAAL,CAAYxC,QAAZ,KAAyB,KAAKyC,IAAL,CAAUzC,QAAV,EAAhC;EACH,GA7fL;;EAAA,SAwgBIC,QAxgBJ,GAwgBI,oBAAW;EACP,WAAU,KAAKuC,MAAL,CAAYvC,QAAZ,EAAV,SAAoC,KAAKwC,IAAL,CAAUxC,QAAV,EAApC;EACH,GA1gBL;;EAAA;EAAA;EA6gBO,SAASE,KAAT,GAAiB;EACpBY,EAAAA,QAAQ,CAACwD,GAAT,GAAexD,QAAQ,CAAC5D,EAAT,CAAYoE,YAAO,CAACqB,GAApB,EAAyBrB,YAAO,CAACuB,GAAjC,CAAf;EACH;;ECxiBD;EACA;EACA;EACA;EAMA,IAAI0B,MAAM,GAAG,KAAb;;EAEA,SAASC,IAAT,GAAgB;EACZ,MAAID,MAAJ,EAAY;EACR;EACH;;EAEDA,EAAAA,MAAM,GAAG,IAAT;EAEAE,EAAAA,OAAc;EACdC,EAAAA,OAAa;EACbC,EAAAA,KAAY;EACf;;EAEDH,IAAI;;ECvBJ;EACA;EACA;EACA;EAae,iBAAwB;;EChBvC;EACA;EACA;EACA;AASAI,UAAG,CAACC,IAAD,CAAH;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
//! @version @js-joda/extra - 0.
|
|
1
|
+
//! @version @js-joda/extra - 0.9.0
|
|
2
2
|
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
4
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
5
|
-
var JSJodaExtra=function(t,n){"use strict";function e(t,e){if(null==t)throw new n.NullPointerException(e+" must not be null");return t}function r(t,e,r){if(!(t instanceof e))throw new n.IllegalArgumentException(r+" must be an instance of "+(e.name?e.name:e)+(t&&t.constructor&&t.constructor.name?", but is "+t.constructor.name:""));return t}var s=function(){function t(t,n){this._start=t,this._end=n}t.of=function(e,r){return r instanceof n.Duration?t.ofInstantDuration(e,r):t.ofInstantInstant(e,r)},t.ofInstantInstant=function(s,i){if(e(s,"startInclusive"),e(i,"endExclusive"),r(s,n.Instant,"startInclusive"),r(i,n.Instant,"endExclusive"),i.isBefore(s))throw new n.DateTimeException("End instant must on or after start instant");return new t(s,i)},t.ofInstantDuration=function(s,i){if(e(s,"startInclusive"),e(i,"duration"),r(s,n.Instant,"startInclusive"),r(i,n.Duration,"duration"),i.isNegative())throw new n.DateTimeException("Duration must not be zero or negative");return new t(s,s.plus(i))},t.parse=function(r){if(e(r,"text"),"string"!=typeof r)throw new n.IllegalArgumentException("text must be a string, but is "+r.constructor.name);for(var s=0;s<r.length;s+=1)if("/"===r.charAt(s)){var i=r.charAt(0);if("P"===i||"p"===i){var o=n.Duration.parse(r.substring(0,s)),a=n.ZonedDateTime.parse(r.substring(s+1,r.length)).toInstant();return t.of(a.minus(o),a)}var u=n.ZonedDateTime.parse(r.substring(0,s)).toInstant();if(s+1<r.length){var h=r.charAt(s+1);if("P"===h||"p"===h){var c=n.Duration.parse(r.substring(s+1,r.length));return t.of(u,u.plus(c))}}var f=n.ZonedDateTime.parse(r.substring(s+1,r.length)).toInstant();return t.of(u,f)}throw new n.DateTimeParseException("Interval cannot be parsed, no forward slash found",r,0)};var s=t.prototype;return s.start=function(){return this._start},s.end=function(){return this._end},s.isEmpty=function(){return this._start.equals(this._end)},s.isUnboundedStart=function(){return this._start.equals(n.Instant.MIN)},s.isUnboundedEnd=function(){return this._end.equals(n.Instant.MAX)},s.withStart=function(n){return t.of(n,this._end)},s.withEnd=function(n){return t.of(this._start,n)},s.contains=function(t){return e(t,"instant"),r(t,n.Instant,"instant"),this._start.compareTo(t)<=0&&(t.compareTo(this._end)<0||this.isUnboundedEnd())},s.encloses=function(n){return e(n,"other"),r(n,t,"other"),this._start.compareTo(n.start())<=0&&n.end().compareTo(this._end)<=0},s.abuts=function(n){return e(n,"other"),r(n,t,"other"),!this._end.equals(n.start())!=!this._start.equals(n.end())},s.isConnected=function(n){return e(n,"other"),r(n,t,"other"),this.equals(n)||this._start.compareTo(n.end())<=0&&n.start().compareTo(this._end)<=0},s.overlaps=function(n){return e(n,"other"),r(n,t,"other"),n.equals(this)||this._start.compareTo(n.end())<0&&n.start().compareTo(this._end)<0},s.intersection=function(s){if(e(s,"other"),r(s,t,"other"),!1===this.isConnected(s))throw new n.DateTimeException("Intervals do not connect: "+this+" and "+s);var i=this._start.compareTo(s.start()),o=this._end.compareTo(s.end());if(i>=0&&o<=0)return this;if(i<=0&&o>=0)return s;var a=i>=0?this._start:s.start(),u=o<=0?this._end:s.end();return t.of(a,u)},s.union=function(s){if(e(s,"other"),r(s,t,"other"),!1===this.isConnected(s))throw new n.DateTimeException("Intervals do not connect: "+this+" and "+s);var i=this._start.compareTo(s.start()),o=this._end.compareTo(s.end());if(i>=0&&o<=0)return s;if(i<=0&&o>=0)return this;var a=i>=0?s.start():this._start,u=o<=0?s.end():this._end;return t.of(a,u)},s.span=function(n){e(n,"other"),r(n,t,"other");var s=this._start.compareTo(n.start()),i=this._end.compareTo(n.end()),o=s>=0?n.start():this._start,a=i<=0?n.end():this._end;return t.of(o,a)},s.isAfter=function(t){return t instanceof n.Instant?this.isAfterInstant(t):this.isAfterInterval(t)},s.isBefore=function(t){return t instanceof n.Instant?this.isBeforeInstant(t):this.isBeforeInterval(t)},s.isAfterInstant=function(t){return this._start.compareTo(t)>0},s.isBeforeInstant=function(t){return this._end.compareTo(t)<=0&&this._start.compareTo(t)<0},s.isAfterInterval=function(t){return this._start.compareTo(t.end())>=0&&!t.equals(this)},s.isBeforeInterval=function(t){return this._end.compareTo(t.start())<=0&&!t.equals(this)},s.toDuration=function(){return n.Duration.between(this._start,this._end)},s.equals=function(n){return this===n||n instanceof t&&(this._start.equals(n.start())&&this._end.equals(n.end()))},s.hashCode=function(){return this._start.hashCode()^this._end.hashCode()},s.toString=function(){return this._start.toString()+"/"+this._end.toString()},t}();var i=!1;return i||(i=!0,s.ALL=s.of(n.Instant.MIN,n.Instant.MAX)),n.use((function(){})),t.Interval=s,Object.defineProperty(t,"__esModule",{value:!0}),t}({},JSJoda);
|
|
5
|
+
var JSJodaExtra=function(t,n){"use strict";function e(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,r(t,n)}function r(t,n){return r=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},r(t,n)}function o(t,e){if(null==t)throw new n.NullPointerException(e+" must not be null");return t}function i(t,e,r){if(!(t instanceof e))throw new n.IllegalArgumentException(r+" must be an instance of "+(e.name?e.name:e)+(t&&t.constructor&&t.constructor.name?", but is "+t.constructor.name:""));return t}var a=n._.MathUtil,s=function(t){function r(n){var e;return(e=t.call(this)||this)._day=a.safeToInt(n),e}e(r,t),r.now=function(t){switch(arguments.length){case 0:return r.now0();case 1:if(o(t,"clockOrZone"),t instanceof n.ZoneId)return r.nowZoneId(t);if(t instanceof n.Clock)return r.nowClock(t);throw new n.IllegalArgumentException("zoneIdOrClock must be an instance of ZoneId or Clock, but is "+t.constructor.name);default:throw new n.IllegalArgumentException("Invalid number of arguments: "+arguments.length)}},r.now0=function(){return this.now(n.Clock.systemDefaultZone())},r.nowZoneId=function(t){return this.now(n.Clock.system(t))},r.nowClock=function(t){var e=n.LocalDate.now(t);return r.of(e.dayOfMonth())},r.of=function(t){if(1<=t&&t<=31)return r.VALUES[t-1];throw new n.DateTimeException("Invalid value for DayOfMonth: "+t)},r.from=function(t){if(t instanceof r)return t;o(t,"temporal");try{return r.of(t.get(n.ChronoField.DAY_OF_MONTH))}catch(e){throw new n.DateTimeException("Unable to obtain DayOfMonth from TemporalAccessor: "+t+" of type "+t.constructor.name,e)}};var s=r.prototype;return s.value=function(){return this._day},s.isSupported=function(t){return t instanceof n.ChronoField?t===n.ChronoField.DAY_OF_MONTH:null!=t&&t.isSupportedBy(this)},s.range=function(e){return o(e,"field"),e===n.ChronoField.DAY_OF_MONTH?e.range():t.prototype.range.call(this,e)},s.get=function(t){return this.range(t).checkValidIntValue(this.getLong(t),t)},s.getLong=function(t){if(o(t,"field"),t===n.ChronoField.DAY_OF_MONTH)return this._day;if(t instanceof n.ChronoField)throw new n.UnsupportedTemporalTypeException("Unsupported field: "+t);return t.getFrom(this)},s.isValidYearMonth=function(t){return null!=t&&t.isValidDay(this._day)},s.query=function(e){return o(e,"query"),i(e,n.TemporalQuery,"query"),e===n.TemporalQueries.chronology()?n.IsoChronology.INSTANCE:t.prototype.query.call(this,e)},s.adjustInto=function(t){return o(t,"temporal"),t.with(n.ChronoField.DAY_OF_MONTH,this._day)},s.atMonth=function(t){return o(t,"month"),t instanceof n.Month?n.MonthDay.of(t,Math.min(this._day,t.maxLength())):n.MonthDay.of(t,Math.min(this._day,n.Month.of(t).maxLength()))},s.atYearMonth=function(t){return o(t,"yearMonth"),t.atDay(Math.min(this._day,t.lengthOfMonth()))},s.compareTo=function(t){return o(t,"other"),i(t,r,"other"),this._day-t._day},s.equals=function(t){return this===t||t instanceof r&&this._day===t._day},s.hashCode=function(){return this._day},s.toString=function(){return"DayOfMonth:"+this._day},r}(n.TemporalAccessor);var u=n._.MathUtil,c=function(t){function r(n){var e;return(e=t.call(this)||this)._day=u.safeToInt(n),e}e(r,t),r.now=function(t){switch(arguments.length){case 0:return r.now0();case 1:if(o(t,"clockOrZone"),t instanceof n.ZoneId)return r.nowZoneId(t);if(t instanceof n.Clock)return r.nowClock(t);throw new n.IllegalArgumentException("zoneIdOrClock must be an instance of ZoneId or Clock, but is "+t.constructor.name);default:throw new n.IllegalArgumentException("Invalid number of arguments: "+arguments.length)}},r.now0=function(){return r.now(n.Clock.systemDefaultZone())},r.nowZoneId=function(t){return r.now(n.Clock.system(t))},r.nowClock=function(t){var e=n.LocalDate.now(t);return r.of(e.dayOfYear())},r.of=function(t){if(1<=t&&t<=366)return r.VALUES[t-1];throw new n.DateTimeException("Invalid value for DayOfYear: "+t)},r.from=function(t){if(o(t,"temporal"),i(t,n.TemporalAccessor,"temporal"),t instanceof r)return t;try{return r.of(t.get(n.ChronoField.DAY_OF_YEAR))}catch(e){throw new n.DateTimeException("Unable to obtain DayOfYear from TemporalAccessor: "+t+" of type "+t.constructor.name,e)}};var a=r.prototype;return a.value=function(){return this._day},a.isSupported=function(t){return t instanceof n.ChronoField?t===n.ChronoField.DAY_OF_YEAR:null!=t&&t.isSupportedBy(this)},a.range=function(e){return o(e,"field"),e===n.ChronoField.DAY_OF_YEAR?e.range():t.prototype.range.call(this,e)},a.get=function(t){return this.range(t).checkValidIntValue(this.getLong(t),t)},a.getLong=function(t){if(o(t,"field"),t===n.ChronoField.DAY_OF_YEAR)return this._day;if(t instanceof n.ChronoField)throw new n.UnsupportedTemporalTypeException("Unsupported field: "+t);return t.getFrom(this)},a.isValidYear=function(t){return this._day<366||n.Year.isLeap(t)},a.query=function(e){return o(e,"query"),i(e,n.TemporalQuery,"query"),e===n.TemporalQueries.chronology()?n.IsoChronology.INSTANCE:t.prototype.query.call(this,e)},a.adjustInto=function(t){return o(t,"temporal"),t.with(n.ChronoField.DAY_OF_YEAR,this._day)},a.atYear=function(t){return o(t,"year"),t instanceof n.Year?t.atDay(this._day):n.LocalDate.ofYearDay(t,this._day)},a.compareTo=function(t){return o(t,"other"),i(t,r,"other"),this._day-t._day},a.equals=function(t){return this===t||t instanceof r&&this._day===t._day},a.hashCode=function(){return this._day},a.toString=function(){return"DayOfYear:"+this._day},r}(n.TemporalAccessor);var h=function(){function t(t,n){this._start=t,this._end=n}t.of=function(e,r){return r instanceof n.Duration?t.ofInstantDuration(e,r):t.ofInstantInstant(e,r)},t.ofInstantInstant=function(e,r){if(o(e,"startInclusive"),o(r,"endExclusive"),i(e,n.Instant,"startInclusive"),i(r,n.Instant,"endExclusive"),r.isBefore(e))throw new n.DateTimeException("End instant must on or after start instant");return new t(e,r)},t.ofInstantDuration=function(e,r){if(o(e,"startInclusive"),o(r,"duration"),i(e,n.Instant,"startInclusive"),i(r,n.Duration,"duration"),r.isNegative())throw new n.DateTimeException("Duration must not be zero or negative");return new t(e,e.plus(r))},t.parse=function(e){if(o(e,"text"),"string"!=typeof e)throw new n.IllegalArgumentException("text must be a string, but is "+e.constructor.name);for(var r=0;r<e.length;r+=1)if("/"===e.charAt(r)){var i=e.charAt(0);if("P"===i||"p"===i){var a=n.Duration.parse(e.substring(0,r)),s=n.ZonedDateTime.parse(e.substring(r+1,e.length)).toInstant();return t.of(s.minus(a),s)}var u=n.ZonedDateTime.parse(e.substring(0,r)).toInstant();if(r+1<e.length){var c=e.charAt(r+1);if("P"===c||"p"===c){var h=n.Duration.parse(e.substring(r+1,e.length));return t.of(u,u.plus(h))}}var f=n.ZonedDateTime.parse(e.substring(r+1,e.length)).toInstant();return t.of(u,f)}throw new n.DateTimeParseException("Interval cannot be parsed, no forward slash found",e,0)};var e=t.prototype;return e.start=function(){return this._start},e.end=function(){return this._end},e.isEmpty=function(){return this._start.equals(this._end)},e.isUnboundedStart=function(){return this._start.equals(n.Instant.MIN)},e.isUnboundedEnd=function(){return this._end.equals(n.Instant.MAX)},e.withStart=function(n){return t.of(n,this._end)},e.withEnd=function(n){return t.of(this._start,n)},e.contains=function(t){return o(t,"instant"),i(t,n.Instant,"instant"),this._start.compareTo(t)<=0&&(t.compareTo(this._end)<0||this.isUnboundedEnd())},e.encloses=function(n){return o(n,"other"),i(n,t,"other"),this._start.compareTo(n.start())<=0&&n.end().compareTo(this._end)<=0},e.abuts=function(n){return o(n,"other"),i(n,t,"other"),!this._end.equals(n.start())!=!this._start.equals(n.end())},e.isConnected=function(n){return o(n,"other"),i(n,t,"other"),this.equals(n)||this._start.compareTo(n.end())<=0&&n.start().compareTo(this._end)<=0},e.overlaps=function(n){return o(n,"other"),i(n,t,"other"),n.equals(this)||this._start.compareTo(n.end())<0&&n.start().compareTo(this._end)<0},e.intersection=function(e){if(o(e,"other"),i(e,t,"other"),!1===this.isConnected(e))throw new n.DateTimeException("Intervals do not connect: "+this+" and "+e);var r=this._start.compareTo(e.start()),a=this._end.compareTo(e.end());if(r>=0&&a<=0)return this;if(r<=0&&a>=0)return e;var s=r>=0?this._start:e.start(),u=a<=0?this._end:e.end();return t.of(s,u)},e.union=function(e){if(o(e,"other"),i(e,t,"other"),!1===this.isConnected(e))throw new n.DateTimeException("Intervals do not connect: "+this+" and "+e);var r=this._start.compareTo(e.start()),a=this._end.compareTo(e.end());if(r>=0&&a<=0)return e;if(r<=0&&a>=0)return this;var s=r>=0?e.start():this._start,u=a<=0?e.end():this._end;return t.of(s,u)},e.span=function(n){o(n,"other"),i(n,t,"other");var e=this._start.compareTo(n.start()),r=this._end.compareTo(n.end()),a=e>=0?n.start():this._start,s=r<=0?n.end():this._end;return t.of(a,s)},e.isAfter=function(t){return t instanceof n.Instant?this.isAfterInstant(t):this.isAfterInterval(t)},e.isBefore=function(t){return t instanceof n.Instant?this.isBeforeInstant(t):this.isBeforeInterval(t)},e.isAfterInstant=function(t){return this._start.compareTo(t)>0},e.isBeforeInstant=function(t){return this._end.compareTo(t)<=0&&this._start.compareTo(t)<0},e.isAfterInterval=function(t){return this._start.compareTo(t.end())>=0&&!t.equals(this)},e.isBeforeInterval=function(t){return this._end.compareTo(t.start())<=0&&!t.equals(this)},e.toDuration=function(){return n.Duration.between(this._start,this._end)},e.equals=function(n){return this===n||n instanceof t&&(this._start.equals(n.start())&&this._end.equals(n.end()))},e.hashCode=function(){return this._start.hashCode()^this._end.hashCode()},e.toString=function(){return this._start.toString()+"/"+this._end.toString()},t}();var f=!1;return f||(f=!0,function(){s.VALUES=new Array(31);for(var t=0;t<31;t++)s.VALUES[t]=new s(t+1)}(),function(){c.VALUES=new Array(366);for(var t=0;t<366;t++)c.VALUES[t]=new c(t+1)}(),h.ALL=h.of(n.Instant.MIN,n.Instant.MAX)),n.use((function(){})),t.DayOfMonth=s,t.DayOfYear=c,t.Interval=h,Object.defineProperty(t,"__esModule",{value:!0}),t}({},JSJoda);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@js-joda/extra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "additional date-time classes that complement those in js-joda",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@js-joda/core": ">=1.11.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@js-joda/core": "^5.3.
|
|
52
|
+
"@js-joda/core": "^5.3.1"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a1ba3e5d59b29185156e61ffc03818c2db11291a"
|
|
55
55
|
}
|