max(start1, start2)<min(end1, end2)就相交了
處理兩個(gè)事件是否有重合的時(shí)間
for d in declined_list: # 循環(huán) 事件列表a
limit_start = d.start # 事件A開始時(shí)間戳
limit_end = d.end # 時(shí)間A結(jié)束時(shí)間戳
for n in normal_list: # 循環(huán)事件列表b
start = n.start # 事件B開始時(shí)間時(shí)間戳
end = n.end # 事件B結(jié)束時(shí)間時(shí)間戳
if min(end, limit_end) - max(start, limit_start) > 5 * 60:
d.updated_status = 'declined'
d.save()
break