compareTo method
Compares this date with another.
Returns a negative value if this is before other
, 0 if equal,
and a positive value if after.
Implementation
@override
int compareTo(LocalDate other) {
int result = year.compareTo(other.year);
if (result != 0) return result;
result = month.compareTo(other.month);
if (result != 0) return result;
return day.compareTo(other.day);
}