List of utility methods to do LocalDate Calculate
boolean | isBankHoliday(List is Bank Holiday return (bankHolidays != null) && bankHolidays.contains(date);
|
boolean | isDayOfWeek(LocalDate d, DayOfWeek dow) Check the LocalDate given to see if it is the DayOfWeek given if (d.getDayOfWeek().compareTo(dow) == 0) { return true; } else { return false; |
boolean | isEqual(LocalDate date1, LocalDate date2) Returns true if a given dates fall on the same day, irregardless of time return date1.isEqual(date2);
|
boolean | isInPeriod(LocalDate subject, LocalDate start, LocalDate end) is In Period return (subject.isAfter(start) || subject.isEqual(start))
&& (subject.isBefore(end) || subject.isEqual(end));
|
boolean | isLess(@Nonnull final LocalDate aDate1, @Nonnull final LocalDate aDate2) is Less return aDate1.compareTo(aDate2) < 0;
|
boolean | isLocalDateAD(LocalDate date) is Local Date AD return date.getYear() > 0;
|
boolean | isLocalDateOrDateTimeType(Class> type) Is the type local date or local date-time? return LocalDate.class.isAssignableFrom(type) || LocalDateTime.class.isAssignableFrom(type); |
boolean | isNotNullAndAfter(LocalDate localDate1, LocalDate localDate2) is Not Null And After if (localDate1 == null || localDate2 == null) { return false; return localDate1.isAfter(localDate2); |
boolean | isOverlapping(LocalDate firstStartDate, LocalDate firstEndDate, LocalDate secondStartDate, LocalDate secondEndDate) is Overlapping boolean isOverlapping = false; if ((firstStartDate == null && firstEndDate == null) || (secondStartDate == null && secondEndDate == null) || (firstStartDate == null && secondStartDate == null) || (firstEndDate == null && secondEndDate == null)) { isOverlapping = true; if (firstStartDate != null && secondStartDate == null && secondEndDate != null) { if (firstStartDate.compareTo(secondEndDate) <= 0) { ... |
boolean | isValid(LocalDate ld1, LocalDate ld2, ZoneId zid, Predicate is Valid while (ld1.compareTo(ld2) != 0) { if (test.test(toDate(ld1.atStartOfDay(zid)))) return true; else ld1 = ld1.plusDays(1); return false; |