vanilla-datetimerange-picker
vanilla-datetimerange-picker copied to clipboard
fix: event should be fired from the element the date picker is attached to
Instead of
window.addEventListener('apply.daterangepicker', function (ev) {
console.log(ev.detail.startDate.format('YYYY-MM-DD'));
console.log(ev.detail.endDate.format('YYYY-MM-DD'));
});
We should be able to write:
new DateRangePicker(element...)
element.addEventListener('apply.daterangepicker', function (ev) {
console.log(ev.detail.startDate.format('YYYY-MM-DD'));
console.log(ev.detail.endDate.format('YYYY-MM-DD'));
});