Reputation: 640
I had a html5 calender of type="datetime"
. I want the past dates to make unselectable.
<input class="form-control" type="datetime" date-time auto-close="true" view="date"
datepicker-options="dateOptions" min-view="date" maxlength="10" format="dd/MM/yyyy"
ng-model="$ctrl.DateInput" required="true">
All the dates inside the rectangle should be in disable state.
Can someone help me?
Upvotes: 1
Views: 577
Reputation: 12874
With Javascript, you can set the min
attribute of the date control. You can also set this from your ViewModal.
var today = new Date().toISOString().split('T')[0];
document.getElementsByName("date-control")[0].setAttribute('min', today);
<input name="date-control" type="date">
Upvotes: 1