This is a simple DateOfBirthPicker
component, built on top of the DatePickerDemo
from shadcn/ui. Adds a YearPicker
and a MonthPicker
to facilitate easier date of birth selection.
- To use the
DateOfBirthPicker
component in a form: - Destructure
formData
andsetFormData
props inside the component. - Un-comment the line which updates
formData
with thedate
state from the picker. - Create the
formData
state in the parent component containing the form, and passformData
andsetFormData
to theDateOfBirthPicker
component.