getOverlappingDaysInIntervals
import { getOverlappingDaysInIntervals } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// 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
@example
// 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