datepicker change date code example
Example 1: datepicker on change
$("#datepicker").on("change",function(){
var selected = $(this).val();
alert(selected);
});
Example 2: on change datepicker and change date increase date in another fuilds
$('#datepicker2').datepicker({
format: 'dd-mm-yyyy',
startDate: '0d',
autoclose: true,
}).on('changeDate', function (selected) {
var startDate = new Date(selected.date.valueOf());
var month = Number($("#con_months_of_contract").val());
$('#datepicker4').datepicker('setStartDate', startDate);
startDate.setDate(startDate.getDate() - 1);
startDate.setMonth(startDate.getMonth() + month);
$("#datepicker4").datepicker("setDate", startDate);
}).on('clearDate', function (selected) {
$('#datepicker4').datepicker('setStartDate', null);
});