Returns the date of birth encoded in input, or null if the spec does not encode DOB or the input fails validation.
input
null
The returned DateOfBirth is a plain calendar date (year/month/day) — NOT a Date instance — to side-step timezone semantics. See DateOfBirth.
DateOfBirth
Date
Document type. Must support "dob" (see supports).
"dob"
supports
Raw user input; will be normalized and validated first.
A DateOfBirth on success, null otherwise.
import { extractDOB } from "nationid/extract";extractDOB("MX_CURP", "GOMC850315HDFRRR07");// { year: 1985, month: 3, day: 15 }extractDOB("SV_DUI", "045678903"); // null (DUI does not encode DOB) Copy
import { extractDOB } from "nationid/extract";extractDOB("MX_CURP", "GOMC850315HDFRRR07");// { year: 1985, month: 3, day: 15 }extractDOB("SV_DUI", "045678903"); // null (DUI does not encode DOB)
Returns the date of birth encoded in
input, ornullif the spec does not encode DOB or the input fails validation.The returned
DateOfBirthis a plain calendar date (year/month/day) — NOT aDateinstance — to side-step timezone semantics. See DateOfBirth.