compareTo method

  1. @override
int compareTo(
  1. HijriDate other
)
override

Orders dates by year, then month, then day.

Implementation

@override
int compareTo(HijriDate other) {
  if (year != other.year) return year.compareTo(other.year);
  if (month != other.month) return month.compareTo(other.month);
  return day.compareTo(other.day);
}