isValidDateRange static method

bool isValidDateRange(
  1. DateTime start,
  2. DateTime end
)

Validates if a date range is valid (start <= end)

Returns true if the range is valid, false otherwise

Implementation

static bool isValidDateRange(DateTime start, DateTime end) {
  return isValidDateTime(start) &&
          isValidDateTime(end) &&
          start.isBefore(end) ||
      start.isAtSameMomentAs(end);
}