Java Utililty Methods LocalDate Calculate

List of utility methods to do LocalDate Calculate

Description

The list of methods to do LocalDate Calculate are organized into topic(s).

Method

booleanisBankHoliday(List bankHolidays, LocalDate date)
is Bank Holiday
return (bankHolidays != null) && bankHolidays.contains(date);
booleanisDayOfWeek(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;
booleanisEqual(LocalDate date1, LocalDate date2)
Returns true if a given dates fall on the same day, irregardless of time
return date1.isEqual(date2);
booleanisInPeriod(LocalDate subject, LocalDate start, LocalDate end)
is In Period
return (subject.isAfter(start) || subject.isEqual(start))
        && (subject.isBefore(end) || subject.isEqual(end));
booleanisLess(@Nonnull final LocalDate aDate1, @Nonnull final LocalDate aDate2)
is Less
return aDate1.compareTo(aDate2) < 0;
booleanisLocalDateAD(LocalDate date)
is Local Date AD
return date.getYear() > 0;
booleanisLocalDateOrDateTimeType(Class type)
Is the type local date or local date-time?
return LocalDate.class.isAssignableFrom(type) || LocalDateTime.class.isAssignableFrom(type);
booleanisNotNullAndAfter(LocalDate localDate1, LocalDate localDate2)
is Not Null And After
if (localDate1 == null || localDate2 == null) {
    return false;
return localDate1.isAfter(localDate2);
booleanisOverlapping(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) {
...
booleanisValid(LocalDate ld1, LocalDate ld2, ZoneId zid, Predicate test)
is Valid
while (ld1.compareTo(ld2) != 0) {
    if (test.test(toDate(ld1.atStartOfDay(zid))))
        return true;
    else
        ld1 = ld1.plusDays(1);
return false;