compareDateTo method

int compareDateTo(
  1. DateTime other
)

Implementation

int compareDateTo(DateTime other) {
  if (this.year > other.year)
    return 1;
  else if (this.year == other.year) if (this.month > other.month)
    return 1;
  else if (this.month == other.month) if (this.day > other.day)
    return 1;
  else if (this.day == other.day)
    return 0;
  else
    return -1;
  else
    return -1;
  else
    return -1;
}