isBefore method
A date before validator.
Implementation
ValidatorFn<DateTime> isBefore(DateTime max, [String? message]) {
return (DateTime? value, BuildContext context) {
if (value != null && value.isAfter(max)) {
return message ?? HookFormScope.of(context).dateBefore(max);
}
return this.call(value, context);
};
}