Browse modulesSchedulingFunctions
Function: findFreeSlotsInWindows()
function findFreeSlotsInWindows(args: {
busy: TimeRange[];
duration: Duration;
step?: Duration;
windows: TimeRange[];
}): TimeRange[];Defined in: shared/scheduling/availability.ts:82
Return every slot of duration that fits inside windows without
overlapping busy.
windowsare caller-precomputed open ranges (e.g. working-hour segments already intersected with the search horizon).busyis compared by absolute instant — time-zone IDs may differ betweenwindowsandbusyentries;Temporal.ZonedDateTime.comparenormalises to UTC before comparing.stepdefaults toduration(non-overlapping, adjacent slots).step < durationproduces overlapping start times.step > durationleaves gaps between slots.
Parameters
| Parameter | Type |
|---|---|
args | { busy: TimeRange[]; duration: Duration; step?: Duration; windows: TimeRange[]; } |
args.busy | TimeRange[] |
args.duration | Duration |
args.step? | Duration |
args.windows | TimeRange[] |