isDate function
Checks whether the given value is a valid DateTime formattedString
Implementation
Validator isDate() {
return (value) => Result(
isValid: DateTime.tryParse(value) != null,
expected: 'a valid date',
value: value,
);
}