indrimuska / angular-moment-picker

Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
http://indrimuska.github.io/angular-moment-picker/
MIT License
525 stars 226 forks source link

min-date not working #252

Closed overjoied closed 6 years ago

overjoied commented 6 years ago

I can't seem to make min-date work. I assigned yesterday's date as min-date but still date picker allows me to select past dates.

<div class="input-group col-lg-6 pl-1 pr-1" moment-picker="startDate" format="YYYY-MM-DD">
     <span class="input-group-addon light-gray-bg">
          <i class="fa fa-calendar silver-text"></i>
     </span>
     <input class="form-control light-gray-bg silver-text border-0" placeholder="Select start date." ng-model="startDate" min-date="minDate" ng-model-options="{ updateOn: 'blur' }" ng-mousedown="alert()" required>
</div>
overjoied commented 6 years ago

I just figured out that I should put min-date on the div tag.. sorry :) It's working now.

<div class="input-group col-lg-6 pl-1 pr-1" moment-picker="startDate" min-date="minDate"  format="YYYY-MM-DD">
     <span class="input-group-addon light-gray-bg">
          <i class="fa fa-calendar silver-text"></i>
     </span>
     <input class="form-control light-gray-bg silver-text border-0" placeholder="Select start date." ng-model="startDate"ng-model-options="{ updateOn: 'blur' }" ng-mousedown="alert()" required>
</div>