A calendar input is a React form control for entering dates or times. HTML provides date, datetime-local, month, time, and week input types. section 9.2.5
Read the selected value according to the data you need:
- Use value for the selected value as a string, such as "2022-W52" for a week input. section 9.2.5
- Use valueAsNumber for a timestamp in most calendar inputs; month inputs instead return months since January 1970. section 9.2.5
- Use min, max, and step to constrain the valid range and keyboard increments. section 9.2.5
A date field
<label>Start date: <input type="date" /></label> // In an event handler: const timestamp = event.target.valueAsNumber; section 9.2.5
