leapYear static method
Implementation
static Validator<DateTime> leapYear({String? error}) => (value, context) {
final DateTimeResource datetimeResource = context.resources.getOrCreate(
value.toString(),
() => DateTimeResource(value),
);
if (datetimeResource.isLeap()) return (true, null);
return (
false,
error ??
context.errors.stringDateErrors.leapYear(
datetimeResource.date.year.toString(),
),
);
};