* @summary Is the given time interval overlapping with another time interval?
13
*
14
* @description
15
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping unless `inclusive` is set to `true`.
16
*
17
* @param intervalLeft - The first interval to compare.
18
* @param intervalRight - The second interval to compare.
19
* @param options - The object with options
20
*
21
* @returns Whether the time intervals are overlapping
22
*
23
* @example
24
* // For overlapping time intervals:
25
* areIntervalsOverlapping(
26
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
27
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
28
* )
29
* //=> true
30
*
31
* @example
32
* // For non-overlapping time intervals:
33
* areIntervalsOverlapping(
34
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
35
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
36
* )
37
* //=> false
38
*
39
* @example
40
* // For adjacent time intervals:
41
* areIntervalsOverlapping(
42
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
43
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
44
* )
45
* //=> false
46
*
47
* @example
48
* // Using the inclusive option:
49
* areIntervalsOverlapping(
50
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
51
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },