how to check time overlap
snippet in php

how to check time overlap

user2024

public function check_time_overlap($start_time1, $end_time1, $start_time2, $end_time2) {
	return (($start_time1) <=  ($end_time2) && ($start_time2) < ($end_time1) ? true : false);
}

// true: overlap
// falseL not overlap

javascript check if two date ranges overlap

user6873

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