Simple, just use the startDate
, as in the example below.
$('input').datepicker({
autoclose: true,
startDate: 'd'
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.css" rel="stylesheet" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
<input type="text" type="text" class="form-control" />
If you want days in the past or future, you can change to startDate: '-5d'
or startDate: '+5d'
, which will put the initial date for 5 days before (-5d) or 5 days after (+5d).
Is using this lib?
– Randrade
@Randrade, that’s right
– Matheus Miranda