I do not have enough reputation on Razzildinho, but I want to offer one small addition that will help users to highlight the selected day on the second datepicker. You can do this by adding this line:
$('#enddate').datepicker('setDate', minDate);
So, in context, it will look like this:
$(document).ready(function(){ $("#startdate").datepicker({ todayBtn: 1, autoclose: true, }).on('changeDate', function (selected) { var minDate = new Date(selected.date.valueOf()); $('#enddate').datepicker('setStartDate', minDate); $('#enddate').datepicker('setDate', minDate);
source share