operator <= method

bool operator <=(
  1. DateTime? other
)

Less than or equal operator for DateTime with nullable DateTime Returns false if other is null

Implementation

bool operator <=(DateTime? other) {
  if (other == null) return false;
  return isBefore(other) || isAtSameMomentAs(other);
}