equalTime method

bool equalTime(
  1. DateTime other, [
  2. bool includeSeconds = true
])

Compara igualdade entre dois DateTime desconsiderando data. É possível configurar para considerar segundos.

Implementation

bool equalTime(DateTime other, [bool includeSeconds = true]) {
  bool isSecondsEqual = includeSeconds ? this.second == other.second : true;

  return this.hour == other.hour &&
      this.minute == other.minute &&
      isSecondsEqual;
}