This is my datepicker field:
<div class="form-group">
<label for="exampleInputBday">Birthday</label>
<input type="text" name="bday" class="datepicker" required>
</div>
This is my javascript:
$(function(){
$('.datepicker').datepicker({
startDate: '-3y',
'format' : 'mm/dd/yyyy',
autoclose: true
})
})
})
When I open the datepicker, the start date is the current date! How to solve?
minDate
?startDate: '-1095',
startDate
sets the earliest date that may be selected; all earlier dates will be disabled. Is this not what you're trying to do? If not, you should read the documentation, all you have to do is set the value of the element to whatever date you choose ?