is LocalDate today Or After - Java java.time

Java examples for java.time:Today

Description

is LocalDate today Or After

Demo Code


//package com.java2s;

import java.time.LocalDate;

public class Main {
    public final static LocalDate TODAY = LocalDate.now();
    public final static LocalDate TBA_DATE = LocalDate.of(2170, 1, 1);

    public static boolean todayOrAfter(LocalDate date,
            LocalDate compareToDate) {
        return (date.equals(compareToDate) || date.isAfter(compareToDate));
    }//from   w ww.  j  a  va 2 s  .co  m

    public static boolean todayOrAfter(LocalDate date) {
        if (date.equals(TBA_DATE))
            return false;
        return todayOrAfter(date, TODAY);
    }
}

Related Tutorials