Date
DD/MM/YYYY. Corrected while typing; the form value is ISO (2026-07-29).
← All examples·date
Built-in validation: Date check
While typing the month can't pass 12 and the day 31; 4 becomes 04/. Dates that don't exist such as 31/02 are rejected. min/max (including today), minimum age (minAge) and start–end (from) are built in.
Preview
Form value: -
Display: -
Details
- Pattern:
99/99/9999 - Preset:
"date" - Form value:
"2026-07-29" - Error keys:
date.incomplete,date.invalid,date.min,date.max,date.minAge,date.beforeFrom - Typing 4 gives 04/; the month can't pass 12, the day 31; 31/02 is invalid.
- reset and setValue accept ISO: setValue("date", "2026-07-29").
Customization
Birth date
Dates after today and under 18 are invalid.
useViraMask(form, {
birthDate: { preset: "date", date: { max: "today", minAge: 18 } },
})Start and end
The end date links to the start with from and can't be before it.
Form value: 2026-07-10
Display: 10/07/2026
Form value: -
Display: -
Other formats
DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD, DD.MM.YYYY, MM/YY, MM/YYYY.
Form value: -
Display: -
For the hook API see useViraMask(); for your own pattern see custom mask.