First date picker
<div class="input-group date " data-provide="datepicker">
<input type="text" name="date1" class="form-control datepicker1" placeholder="Select pick up date">
</div>
Second datepicker
<div class="input-group date" data-provide="datepicker">
<input type="text" name="date2" class="form-control datepicker2" placeholder="Select delivery date">
</div>
There are two date pickers. The value of the second date picker is based on the first one. If the user chooses today's date on first date picker then the date picker 2 will only allow choosing date starting from tomorrow.
$(document).ready(function(){
$('.datepicker1').datepicker( {
format: 'dd-mm-yyyy',
startDate:'+0d',
autoclose: true,
onSelect: function(date){
var date1 = $('.datepicker1').datepicker('getDate');
var date = new Date( Date.parse( date1 ) );
date.setDate( date.getDate() + 1 );
var newDate = date.toDateString();
newDate = new Date( Date.parse( newDate ) );
$('.datepicker2').datepicker("option","minDate",newDate);
}
});
$('.datepicker2').datepicker( {
format: 'dd-mm-yyyy',
autoclose: true,
minDate:0,
});
});
if the user chooses 10-04-2019 in the first date picker then the user should only able to choose from 11-04-2019 in the second date picker.
this is the requirement