Skip to content

Commit

Permalink
Fix Timespan intersection hopefully for the last time now (lets see h…
Browse files Browse the repository at this point in the history
…ow many bugs are in there)
  • Loading branch information
extremeCrazyCoder committed Oct 20, 2020
1 parent 13671bb commit 5b5f256
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Core/src/main/java/de/tor/tribes/types/TimeSpan.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public boolean intersects(TimeSpan pSpan) {
if(!pSpan.isValidAtEveryDay()) {
Long otherStart = DateUtils.getFragmentInMilliseconds(new Date(theOtherSpan.getMinimum()), Calendar.DATE);
Long otherEnd = DateUtils.getFragmentInMilliseconds(new Date(theOtherSpan.getMaximum()), Calendar.DATE);
theOtherSpan = Range.between(otherStart, otherEnd);
theOtherSpan = Range.between(otherStart, otherEnd - 1);
} else {
theOtherSpan = Range.between(theOtherSpan.getMinimum(), theOtherSpan.getMaximum() - 1);
}
Expand Down Expand Up @@ -274,6 +274,9 @@ public boolean intersects(TimeSpan pSpan) {
}
}

thisSpan = Range.between(thisSpan.getMinimum(), thisSpan.getMaximum() - 1);
theOtherSpan = Range.between(theOtherSpan.getMinimum(), theOtherSpan.getMaximum() - 1);

return thisSpan.isOverlappedBy(theOtherSpan);
}

Expand Down

0 comments on commit 5b5f256

Please sign in to comment.