TL;DR Is there a way to get the last cleared date?
I want to fire a callback function when the user clear/unselect a date and I want to pass the unselected date to the function. How can I do this?
Following is the initialization.
$('#bd-picker').datepicker({
multidate: true,
weekStart: 1,
maxViewMode: 2,
clearBtn: false,
format:'yyyy-mm-dd',
daysOfWeekHighlighted: "0,6",
autoclose: false,
todayHighlight: true,
});
I tried the following with no luck. It doesn't even fire the callback.
$('#bd-picker').datepicker().on('clearDate', function (event) {
const cleared = $('#bd-picker').datepicker('getDate')
console.log(event.date)
console.log(cleared)
});