0

I have a question concerning angular-datepicker

I can't get the max-date functionality to work on my project. I've tried several ways to pass the maxDate variable (set to current day = new Date() ) but nothing happens.

This is my markup:

div class="date-picker" 
id="calendar_to" 
date-picker="calendar_to" 
watch-direct-changes 
date 
after="calendar_from" 
before="calendar_to" 
min-view="date" 
max-view="date" 
max-date></div>

I tried max-date="maxDate", max-date="{{maxDate}}", max-date="{maxDate}", max-date="{new Date()}", etc..

And I tried declaring maxDate in the controller and in a directive.

Which is the right way to do this? Haven't found a a solution in the documentation nor in the various issues reported.

Any help out there?

Thanks

MiguelRivero
  • 137
  • 1
  • 9

1 Answers1

0

In HTML: "datepicker ng-model="date" name="Date" min-date="minDate" max-date="maxDate" date-disabled="disabled">

In the controller set:
$scope.maxDate=new Date(yyyy,mm,dd,hr,min,s);