hofff / contao-calendarfield

GNU Lesser General Public License v3.0
18 stars 3 forks source link

fire onSelect event #44

Closed GMTeams closed 3 years ago

GMTeams commented 6 years ago

Usually I would call the calendar within a div with some id, e.g.:

<div id="calendar"></div>

$(document).ready(function () {
    $("#calendar").datepicker({
        onSelect: function () {
            // do something
        }
    });

});

But that's not working because the calendar applies into HTML body. How can I fire the event?

Thanks!

cliffparnitzky commented 3 years ago

Due to the change to flatpickr with version 4.0.0 this not longer relevant. Please refere to the docs: https://flatpickr.js.org/events/