exclude<T>(): Interval<T>[]
Excludes intervals from a set of intervals using a provided comparator function.
Example 1
Example 1
const includeDates = [ [new Date("2023-01-01"), new Date("2023-01-20")] ]; const excludeDates = [ [new Date("2023-01-05"), new Date("2023-01-10")] ]; exclude(includeDates, excludeDates, { compareFn: (a, b) => a.getTime() - b.getTime() }); // [ // [new Date("2023-01-01"), new Date("2023-01-05")], // [new Date("2023-01-10"), new Date("2023-01-20")] // ]