I'm setting the value of a bootstrap datepicker by making use of the setValue
method provided.
For example
tripToDatePicker.setValue(tripFromDatePicker.date);
But for some reason the calendar is not updated
Go to line 1399 and find format: 'mm/dd/yyyy' . Now you can change the date format here.
You can check to see if the datepicker script has loaded using: if ($. fn. datepicker) { // ... }
autoclose. Whether or not to close the datepicker immediately when a date is selected.
Edit:
http://www.eyecon.ro/bootstrap-datepicker/ is not much documented, you should try http://eternicode.github.io/bootstrap-datepicker/.
anyway the code below will work for you
$("#dp1").datepicker("update", "02-16-2012");
or
$("#dp1").datepicker("setValue", "02-17-2012");
where "#dpi" is the id of the text field on whcih datepicker is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With