Last active
October 7, 2022 13:07
-
-
Save Mmarin95/5f9e315b6b88c25e0a8180b07f007ef7 to your computer and use it in GitHub Desktop.
Check if date range overlaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e1start = e1.start.getTime(); | |
var e1end = e1.end.getTime(); | |
var e2start = e2.start.getTime(); | |
var e2end = e2.end.getTime(); | |
return (e1start > e2start && e1start < e2end || e2start > e1start && e2start < e1end); | |
// Simplified | |
startA <= endB && endA >= startB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment