select
Description
fires when a new option is selected in a date range pickerParameters
- ev - (object) a CustomEvent object
Example
<script>
import { DateRangePicker } from "@wx/svelte-core";
import { getContext } from "svelte";
// importing helpers
const wh = getContext("wx-helpers");
// specifying the handler function
function showChanges(ev) {
// using the showNotice() helper function to show a message on change of the date
wh.showNotice({
text: `Date changed to ${JSON.stringify(ev.detail.selected)}`,
});
}
</script>
<DateRangePicker on:select={showChanges} />
Details
The handler function returns an object with the newly selected value of the date range picker (start and end dates of the selected range).
Related article: Catching the change of the selected date
Related sample: DateRangePicker