Reputation: 4263
I am seeing a lot of questions in stack overflow regarding disabling past dates in bootstrap datepicker.
But i want to enable past dates in bootstrap datepicker.
Here is my code, and i don't know what i miss in this.
<input type='text' id="campaignCreateDate" data-date-format="dd-M-yyyy" class="form-control datePicker" name="proposed_start_date"/>
and this is my js script
$('#campaignCreateDate').datepicker({
todayHighlight: true,
autoclose: true,
format: 'dd-M-yyyy',
}).datepicker('setDate',new Date());
I also tried with only a simple tag as below:
<input type='text' id="testStartDate" class="form-control datePicker" name="proposed_start_date"/>
without any code in js, but still the past dates are not shown.
i.e, if today is 04/12/2018, i am not able to select 03/12/2018 or any dates before that.
Upvotes: 1
Views: 2827