Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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
function getOverlappingDaysInIntervals<DateType extends Date>(intervalLeft: Interval<DateType>, intervalRight: Interval<DateType>): number;
§
getOverlappingDaysInIntervals<DateType extends Date>(intervalLeft: Interval<DateType>, intervalRight: Interval<DateType>): number
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
intervalLeft: Interval<DateType>
[src]
  • The first interval to compare.
§
intervalRight: Interval<DateType>
[src]
  • The second interval to compare.

§Return Type

§
number
[src]

The number of days that overlap in two time intervals