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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.