vanilla-datetimerange-picker icon indicating copy to clipboard operation
vanilla-datetimerange-picker copied to clipboard

fix: event should be fired from the element the date picker is attached to

Open mfazekas opened this issue 2 years ago • 0 comments

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'));
    });

mfazekas avatar Dec 11 '23 15:12 mfazekas