Example: new TimeRange([start, end]). Creates an interval key from a { start, end } object or tuple.
ReadonlyendReadonlykindReadonlystartExample: range.begin(). Returns the inclusive start of the range in milliseconds since epoch.
Example: range.compare(otherRange). Compares this key to another key for ordering.
Example: range.contains(otherRange). Returns true when this range fully contains the supplied temporal value.
Example: range.duration(). Returns the temporal duration of the range in milliseconds.
Example: range.end(). Returns the inclusive end of the range in milliseconds since epoch.
Example: range.equals(otherRange). Returns true when the supplied key is the same TimeRange.
Example: range.intersection(otherRange). Returns the overlapping portion of this range and the supplied temporal value, if any.
Example: range.isAfter(otherRange). Returns true when this range begins strictly after the supplied temporal value ends.
Example: range.isBefore(otherRange). Returns true when this range ends strictly before the supplied temporal value begins.
Example: range.midpoint(). Returns the midpoint of the range in milliseconds since epoch.
Example: range.overlaps(otherRange). Returns true when this range overlaps the supplied temporal value.
Example: range.timeRange(). Returns this key as a TimeRange.
Example: range.toJSON(). Returns { start, end } as ms-since-epoch
numbers — the same shape JsonTimeRangeInput accepts, so the result
round-trips through new TimeRange(range.toJSON()) and JSON wire
formats. Implicitly invoked by JSON.stringify(range).
Example: range.toString(). Returns an ISO-8601 representation of
the range as start/end, e.g. 2025-01-15T09:00:00.000Z/2025-01-15T10:00:00.000Z.
Useful for debug logs and human-readable display.
Example: range.trim(otherRange). Returns this range clipped to the supplied temporal value, if the two overlap.
Example: range.type() // "timeRange". Returns the key kind.
StaticfromExample: TimeRange.fromCalendar("week", "2025-01-01", { timeZone: "UTC", weekStartsOn: 1 }). Creates the containing calendar range for the supplied reference.
StaticfromExample: TimeRange.fromDate("2025-01-01", { timeZone: "Europe/Madrid" }). Creates the local calendar-day range for the supplied ISO date.
A time interval event key with inclusive start and end boundaries. Example:
new TimeRange({ start, end }).