Validates whether an input is a valid Date of Birth.
Date of birth in any format parseDob accepts.
parseDob
Optional
Optional { minAge, maxAge, referenceDate }.
{ minAge, maxAge, referenceDate }
true if the date exists, is not in the future, and satisfies the age limits.
true
isValidDob('2000-01-15', { minAge: 18, referenceDate: new Date('2026-01-01') }); // trueisValidDob('2015-01-01', { minAge: 18, referenceDate: new Date('2026-01-01') }); // false Copy
isValidDob('2000-01-15', { minAge: 18, referenceDate: new Date('2026-01-01') }); // trueisValidDob('2015-01-01', { minAge: 18, referenceDate: new Date('2026-01-01') }); // false
Validates whether an input is a valid Date of Birth.