select
Description
fires when a new date is selected in a date pickerParameters
- ev - (object) a CustomEvent object
Example
<script>
import { DatePicker} 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 ${ev.detail.selected}` });
}
</script>
<DatePicker width="100%" on:select={showChanges} />
Details
The handler function returns an object with the newly selected value of the date picker.
Related article: Catching the change of the selected date
Related sample: DatePicker