isAfter method

bool isAfter(
  1. DateTime first,
  2. DateTime second, {
  3. bool needDayComparison = true,
})

returns true if first is after second

Implementation

bool isAfter(
  DateTime first,
  DateTime second, {
  bool needDayComparison = true,
}) {
  return first.year > second.year ||
      (first.year == second.year && first.month > second.month) ||
      (needDayComparison &&
          (first.year == second.year &&
              first.month == second.month &&
              first.day > second.day));
}