compareAsc static method

int compareAsc(
  1. DateTime dateLeft,
  2. DateTime dateRight
)

Compare the two dates and return 1 if the first date isAfter the second, -1 if the first date isBefore the second or 0 first date isEqual the second.

Implementation

static int compareAsc(DateTime dateLeft, DateTime dateRight) {
  if (dateLeft.isAfter(dateRight)) {
    return 1;
  } else if (dateLeft.isBefore(dateRight)) {
    return -1;
  } else {
    return 0;
  }
}