JavaScript时间段重叠
删除重复的时间段 例如:00:00-00:30 和 00:00-01:00
来源于网络
function compareDate(){
var begin = ['2015-01-02 10:01:38','2015-01-04 09:28:12','2015-01-11 01:37:13'];
var over = ['2015-01-04 10:27:21','2015-01-09 21:28:13','2015-01-16 10:22:23'];
begin = begin.sort();
over = over.sort();
for(i=1;i<begin.length;i++){
if (begin[i] <= over[i-1]){
alert("时间有重复!");
return false;
}
}
alert("时间没有重复!");
return true;
}