I am using http://www.daterangepicker.com/#usage package and currently facing some difficulties in clearing the selection. Based on the documentation, there is a clear option but it doesn't work/cleared after I click to apply button.
This is the codes:
$(function() {
$('input[name="datefilter"]').daterangepicker({
autoUpdateInput: false,
locale: {
cancelLabel: 'Clear'
}
});
$('input[name="datefilter"]').on('apply.daterangepicker', function(ev, picker) {
$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
});
$('input[name="datefilter"]').on('cancel.daterangepicker', function(ev, picker) {
$(this).val('');
});
});
Does anyone have the same experience? how to solve this issue? looks like this package is not maintained anymore :(