Sandeep Talabathula

Date period overlapping scenarios

October 28, 2017

Here is the code that does the magic:

var isOverlapping = ((A == null || D == null || A <= D) && (C == null || B == null || C <= B) && (A == null || B == null || A <= B) && (C == null || D == null || C <= D));

Where..

A -> 1Start

B -> 1End

C -> 2Start

D -> 2End

Proof? Check out this test console code gist.


Originally posted on Things on Tech.

← All posts