* @param s2 * @param e2 * @param isStrict 是否严格遵守不能重叠,例如如果为true 那么8:00-8:30 和8:30-9:00 时间段比较为true * @return true重叠。false不重叠 public static boolean isOverlap(LocalTime s1, LocalTime e1, LocalTime s2, LocalTime e2, boolean isStrict) { if (s1.isAfter(e1) || s2.isAfter(e2)) { throw new DateTimeException("endDate不能小于startDate"); if (isStrict) { if (!(s1.compareTo(e2) >0 || e1.compareTo(s2) < 0)) { return true; } else { if (!(s1.compareTo(e2) >=0 || e1.compareTo(s2) <= 0)) { return true; return false;