javascript check if two date ranges overlap

JavaScript
if((StartDate1 <= EndDate2) && (StartDate2 <= EndDate1)) {
  	//overlapping dates
}
Source

Also in JavaScript: