I have an input element with an attached datepicker created using bootstrap-datepicker.
-
Here is my code for that:
$('#date-daily').datepicker().on('changeDate', function(e) {
//$('#other-input').val(e.format(0,"dd/mm/yyyy"));
//alert(e.date);
//alert(e.format(0,"dd/mm/yyyy"));
//console.log(e.date);
});
Just uncomment the one you prefer.
The first option changes the value of other input element.
The second one alerts the date with datepicker default format.
The third one alerts the date with your own custom format.
The last option outputs to log (default format date).
It's your choice to use the e.date , e.dates (for múltiple date input) or e.format(...).
here some more info