I am using bootstrap-datepicker from here: https://github.com/eternicode/bootstrap-datepicker
version: 2.3.2
I am having trouble to clear the date values of
Current version 1.4.0 has clearBtn option:
$('.datepicker').datepicker({
clearBtn: true
});
Besides adding button to interface it allows to delete value from input box manually.
you have to do it in that way:
$('#datepicker').datepicker('clearDates');
You can use jQuery to clear the value of your date input.
For exemple with a button and a text input like this :
<input type="text" id="datepicker">
<button id="reset-date">Reset</button>
You can use the .val() function of jQuery.
$("#reset-date").click(function(){
$('#datepicker').val("").datepicker("update");
})
I know its too late to answer, but in my scenario below code was not working.
$('#datepicker').val("");
$('#datepicker').val('').datepicker('update');
$('#datepicker').datepicker('update','');
here is my solution.
$('#datepicker').val('').datepicker('remove').datepicker();
I did clear datepicker value first then removed datepicker and again reinitialize datepicker. its resolved my problem.