I have an application in PHP where I use bootstrap datepicker.
I need to disable all past dates in the datepicker before today. I was referred to this link for doing that.
I edited the datepicker's JS according to the information provided in that source, but it still isn't working.
Here's my JS code:
$('.sandbox-container input').datepicker({
format: "dd/mm/yyyy",
orientation: "auto",
startDate: new Date(), //here I tried to set the date
clearBtn: true
});
And here's my PHP code:
<div class="sandbox-container">
<div class="form-group col-sm-6 col-xs-12">
<input type="text" class="form-control date-selecter" value="Date From" id="datefrom" name="datefrom">
</div>
<div class="form-group col-sm-6 col-xs-12">
<input type="text" class="form-control date-selecter" value="Date To" id="dateto" name="dateto">
</div>
</div>
Can anyone please help me to do this?