Skip to main content
Very Popular
Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.1/getOverlappingDaysInIntervals/index.ts";

Examples

// For overlapping time intervals adds 1 for each started overlapping day: getOverlappingDaysInIntervals( { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) } ) //=> 3

// For non-overlapping time intervals returns 0: getOverlappingDaysInIntervals( { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }, { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) } ) //=> 0

Parameters

dirtyIntervalLeft: Interval
  • the first interval to compare. See [Interval]docs/Interval
dirtyIntervalRight: Interval
  • the second interval to compare. See [Interval]docs/Interval

Returns

number

the number of days that overlap in two time intervals