我有以下的Javascript成为对象:的Javascript检查是否范围重叠
function checkTimeOverlapping() {
var scheduleIntervalContainerWrappers = [];
var scheduleIntervalContainerWrapper1 = {};
scheduleIntervalContainerWrapper1.start = '08:00';
scheduleIntervalContainerWrapper1.end = '10:00';
scheduleIntervalContainerWrappers.push(scheduleIntervalContainerWrapper1);
var scheduleIntervalContainerWrapper2 = {};
scheduleIntervalContainerWrapper2.start = '09:00';
scheduleIntervalContainerWrapper2.end = '14:00';
scheduleIntervalContainerWrappers.push(scheduleIntervalContainerWrapper2);
...
alert(scheduleIntervalContainerWrappers);
}
,我会检查scheduleIntervalContainerWrapper重叠开始和结束时间。 有没有可能在纯js中做到这一点?
'scheduleIntervalContainerWrapper1.end'丢失... – Rayon
由于JavaScript是一种图灵完备的语言,我想是的。 – 2016-04-26 08:03:42
http://nedbatchelder.com/blog/201310/range_overlap_in_two_compares.html – georg