0

I am facing issue with disabling date in angular-datepicker. This is how I have defined datepicker:-

<datepicker date-format="{{pattern}}" 
            button-prev="<i class='fa fa-arrow-left' ></i>" 
            button-next="<i class='fa fa-arrow-right'></i>">
  <input class="form-control ng-valid ng-valid-number ng-valid-max ng-valid-min ng-dirty ng-pristine" 
         name="pointAllocDate" type="text" 
         placeholder="Select Date*" id="pointAllocDate" required="required" 
         autocomplete="off" />
</datepicker>

I have defined pattern in angularjs controller as

$scope.pattern = 'yyyy-MM-dd HH:mm:ss';

Linked the css and js for datepicker as follows:-

<link href="css/angular-datepicker.css" rel="stylesheet" type="text/css" />
<script src="/js/angular-datepicker.js"></script>

I am not getting how to disable future dates in this datepicker.Any help would be appreciable.

Pop-A-Stash
  • 6,572
  • 5
  • 28
  • 54
Divya
  • 87
  • 1
  • 10

1 Answers1

0

You will need to use date-max-limit="today" in the datepicker.

In the variable today, set today's date. It will set the maximum date as today and will disable the future dates. For more reference visit this: https://github.com/720kb/angular-datepicker/blob/master/README.md

Harshad
  • 134
  • 1
  • 6