Example: new Interval(["bucket", start, end]). Creates a labeled interval key from a { value, start, end } object or tuple.
ReadonlyendReadonlykindReadonlystartReadonlyvalueExample: interval.asString(). Returns the interval label as a string.
Example: interval.begin(). Returns the inclusive start of the interval in milliseconds since epoch.
Example: interval.compare(otherInterval). Compares this key to another key for ordering.
Example: interval.contains(range). Returns true when this interval fully contains the supplied temporal value.
Example: interval.duration(). Returns the temporal duration of the interval in milliseconds.
Example: interval.end(). Returns the inclusive end of the interval in milliseconds since epoch.
Example: interval.equals(otherInterval). Returns true when the supplied key has the same label and temporal extent.
Example: interval.intersection(range). Returns the temporal intersection with the supplied value, if any.
Example: interval.isAfter(range). Returns true when this interval begins strictly after the supplied temporal value ends.
Example: interval.isBefore(range). Returns true when this interval ends strictly before the supplied temporal value begins.
Example: interval.overlaps(range). Returns true when this interval overlaps the supplied temporal value.
Example: interval.timeRange(). Returns the interval extent as a TimeRange.
Example: interval.trim(range). Returns this interval clipped to the supplied temporal value, preserving its label when overlapping.
Example: interval.type() // "interval". Returns the key kind.
Example: interval.valueOf(). Returns the interval label.
StaticfromExample: Interval.fromCalendar("month", "2025-01", { timeZone: "America/New_York", value: "2025-01" }). Creates a labeled calendar interval for the supplied reference.
StaticfromExample: Interval.fromDate("2025-01-01", { timeZone: "UTC" }). Creates a labeled local-day interval using the ISO date string as the default label.
A labeled time interval event key. Example:
new Interval({ value: "bucket", start, end }).