我有我startDate
兩個日期和endDate
比較日期衝突
而且
現在我需要檢查newStartDate
和newEndDate
不在之間甚至相互矛盾與startDate
和endDate
例如:
start date = 11/03/2016
end date = 11/15/2016
newStartDate = 11/16/2016
newEndDate = 11/23/2016
(^^^This one should return true)
newStartDate = 11/01/2016
newEndDate = 11/02/2016
(^^^This one should return true)
newStartDate = 11/04/2016
newEndDate = 11/12/2016
(^^^This one should return false)
newStartDate = 11/01/2016
newEndDate = 11/05/2016
(^^^This one should return false)
newStartDate = 11/12/2016
newEndDate = 11/22/2016
(^^^This one should return false)
newStartDate = 11/01/2016
newEndDate = 11/24/2016
(^^^This one should return false)
newStartDate = 11/01/2016
newEndDate = 11/03/2016
(^^^This one should return false)
請幫我寫這種邏輯的java代碼。
請在發佈前徹底搜索Stack Overflow。 –