Standalone factories construct Ranges from raw inputs, endpoint pairs, or single interval strings. When you already hold a typed point, call to() or range() on it directly.
Creates an inclusive DateRange spanning two calendar dates. When the second argument is a duration like '7 days', the final day sits six days after the start date so the span covers seven days total.
Creates a half-open DateTimeRange that includes its start moment and excludes its end. When the end input carries no explicit time zone, it is read in the start moment’s zone.
Parameters
startDateTimeInput | stringrequired
Start moment input, or an interval string when end is omitted.
endDateTimeInput | DurationInput | ReadOptions
Exclusive end moment, duration length, or options object for an interval string.
optionsZone | ReadOptions
Time zone or read options for both endpoints.
Returns
DateTimeRange
A half-open DateTimeRange, or null when loose mode cannot read an endpoint.
Creates a half-open TimeRange between two times of day, excluding its end time. When the end time is earlier on the clock than the start time, the range wraps across midnight.
Parameters
startTimeInput | stringrequired
Start clock input, or an interval string when end is omitted.
endTimeInput | DurationInput | ReadOptions
Exclusive end time, clock duration, or options object for an interval string.
optionsZone | ReadOptions
Time zone or read options when extracting times from timestamps.
Returns
TimeRange
A half-open TimeRange, or null when loose mode cannot read an endpoint.