betweenDates method

B betweenDates(
  1. DateTime start,
  2. DateTime end, {
  3. bool inclusiveStart = true,
  4. bool inclusiveEnd = true,
  5. String? message,
})

Validate that the DateTime is within the specified date range. @return The builder for chaining

Implementation

B betweenDates(
  DateTime start,
  DateTime end, {
  bool inclusiveStart = true,
  bool inclusiveEnd = true,
  String? message,
}) {
  assert(!end.isBefore(start), 'end must be >= start');
  return add(
    isDateBetween(start, end, inclusiveStart: inclusiveStart, inclusiveEnd: inclusiveEnd),
    message: message,
  );
}