T00rk / bootstrap-material-datetimepicker

Datepicker for bootstrap-material
http://t00rk.github.io/bootstrap-material-datetimepicker/
MIT License
9 stars 4 forks source link

Change event is triggered 3 times #152

Open mohsin1122 opened 7 years ago

mohsin1122 commented 7 years ago

change event is triggering 3 time on calender OK click

$('.datepicker').bootstrapMaterialDatePicker({ weekStart: 0, time: false }).on('change', function (e, date) {
            alert($('#date').val());
        });
mohsin1122 commented 7 years ago

every time open calender and press ok while on same screen the change event is triggered previous +1 times

plasebo commented 7 years ago

Call it this way:

$('.datepicker').bootstrapMaterialDatePicker({ weekStart: 0, time: false }); $('.datepicker').on('change', function (e, date) { alert($('#date').val()); });

Avoid chaining