import { getOverlappingDaysInIntervals } from "https://deno.land/x/date_fns@v2.12.0/index.js";
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 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
// 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