angular-datepicker icon indicating copy to clipboard operation
angular-datepicker copied to clipboard

MaxDate help

Open miguelRivero opened this issue 10 years ago • 5 comments

Hi!

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 avatar Feb 22 '16 10:02 miguelRivero

Hello Miguel,

your max-date should be a moment date actually.

http://momentjs.com/

AllanStepps-old-account avatar Feb 22 '16 12:02 AllanStepps-old-account

I managed to make it work. Now I', struggling to recover the isbefore, isafter functionality, that seems lost in new version. Is it? But maybe this is material for another issue.

miguelRivero avatar Feb 23 '16 10:02 miguelRivero

@miguelRivero Can you please explain how you got it to work? I am having the same problem.

amylaun avatar Mar 15 '16 21:03 amylaun

Can you please explain how you got it to work? I am having the same problem too.

cheikhnadiouf avatar Apr 20 '16 05:04 cheikhnadiouf

I included moment.js, which is not explicitly mandatory but apparently is to work fine.

miguelRivero avatar Apr 20 '16 07:04 miguelRivero