onchange
Description
Optional. Fires when a new date is selected in a date pickerUsage
onchange?: (ev: { value: Date || null }) => void;
Parameters
The callback of the event takes an object with the following parameter:
- value - (required) Date object with the date as a newly selected value
Example
<script>
function handleSelect({value}) {
console.log(value);
// date object
}
</script>
<DatePicker onchange={handleSelect} />
Details
The handler function receives a date object with the date as a newly selected value of the date picker or null if the value is cleared.
Related article: Catching the change of the selected date
Related sample: DatePicker