Kaizen
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.

  • windows are caller-precomputed open ranges (e.g. working-hour segments already intersected with the search horizon).
  • busy is compared by absolute instant — time-zone IDs may differ between windows and busy entries; Temporal.ZonedDateTime.compare normalises to UTC before comparing.
  • step defaults to duration (non-overlapping, adjacent slots). step < duration produces overlapping start times. step > duration leaves gaps between slots.

Parameters

ParameterType
args{ busy: TimeRange[]; duration: Duration; step?: Duration; windows: TimeRange[]; }
args.busyTimeRange[]
args.durationDuration
args.step?Duration
args.windowsTimeRange[]

Returns

TimeRange[]

On this page