Skip to main content

change

Description

fires when a new date is selected in a calendar

Parameters

- value - (object) an object with the newly selected value of the calendar or *null* if the value is cleared

Example

<script>
function handleChange(ev){
const newValue = ev;
console.log(newValue);
// =>{value: Thu Apr 20 2023 00:00:00 GMT+0300}
}
</script>

<Calendar value={new Date(2022, 2, 18)} onchange={handleChange}/>

Details

The handler function receives an object with the newly selected value of the calendar or null if the value is cleared.

Related article: Catching the change of the selected date