isEarlierDateThan method

bool isEarlierDateThan(
  1. DateTime other
)

Implementation

bool isEarlierDateThan(DateTime other) {
  final otherUtc = other.toUtc();
  if (toUtc().year < otherUtc.year) {
    return true;
  } else if (toUtc().year == otherUtc.year) {
    if (toUtc().month < otherUtc.month) {
      return true;
    } else if (toUtc().month == otherUtc.month) {
      if (toUtc().day < otherUtc.day) {
        return true;
      }
    }
  }
  return false;
}