isBefore method

bool isBefore(
  1. LocalDate other
)

Returns true if this date is before other.

Example:

final date1 = LocalDate(2024, 6, 27);
final date2 = LocalDate(2024, 6, 28);
print(date1.isBefore(date2)); // true
print(date2.isBefore(date1)); // false

Implementation

bool isBefore(LocalDate other) => compareTo(other).isLessThan(0);