onChange
Description
Fires when a new option is selected in the time pickerUsage
onChange?: (ev: { value: Date }) => void;
Parameters
The callback of the event takes an object with the following parameter:
- value - (required) a date object with the the newly selected value
Example
function handleSelect({ value }: { value: Date }) {
console.log(value);
}
<TimePicker onChange={handleSelect} />
Details
The handler function receives a date object with the newly selected value of the time picker.
Related article: Catching the change of the selected date