I have a method wherein have to check whether aLocalDate falls in between two java.util.Date values. there are methods after and before in java.util.Date and there are methods isAfter and isBefore in LocalDate.
The code snippet which i have is as :
/**
* checks if date passed falls between start & end date
*
* @param date
* @param startDate
* @param endDate
* @return
*/
public static boolean isBetween(Date date, Date startDate, Date endDate) {
return (startDate == null || date.after(startDate) || date.equals(startDate))
&& (endDate == null || date.before(endDate) || date.equals(endDate));
}
There is no method in the API to compare across..