jQuery:
$("#min").datepicker({maxDate: 0, changeMonth: true, changeYear: true });
$("#max").datepicker({maxDate: 0, changeMonth: true, changeYear: true });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/js/bootstrap-datepicker.min.js"></script>
<input type="text" class="form-control" name="from" id="min">
<span class="input-group-addon"> to </span>
<input type="text" class="form-control" name="to" id="max">
Anyone can please tell me Why this not working and How can I solve this?
2
Answers
In this below example will help you here I have changed
maxDate:0
tostartDate:01/10/2018
andendDate:02/10/2018
so your max date will befeb 10 2018
Try this snippet. Added validations as well.