range<E> static method
Validates that the date is within start and end (inclusive).
DateRules.range(startDate, endDate, error: 'Date out of range')
Implementation
static Rule<DateTime, E> range<E>(
DateTime start,
DateTime end, {
required E error,
}) =>
PredicateRule(
predicate: (value) =>
(value.isAfter(start) || value.isAtSameMomentAs(start)) &&
(value.isBefore(end) || value.isAtSameMomentAs(end)),
error: error,
);