Skip to main content

select

Description

fires when a new option is selected in a date range picker

Parameters

  • ev - (object) a CustomEvent object. Its detail property contains:
    • selected - (object) an object with the newly selected value (start and end dates of the selected range) or null if the value is cleared

Example

<script>
function handleSelect(ev){
const newValue = ev.detail;
console.log(newValue);
// => an object with the start and end dates of the selected range
}
</script>

<DateRangePicker on:select={handleSelect} />

Details

The handler function receives an object with the newly selected value of the date range picker (start and end dates of the selected range) or null if the value is cleared.

Related article: Catching the change of the selected date

Related sample: DateRangePicker