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
527 stars 229 forks source link

After using subtract(), the month is selectable but invalid #260

Open MeeraLathika opened 6 years ago

MeeraLathika commented 6 years ago

Hi, First of all, let me tell you that moment picker is beautiful. I am pretty new to the picker. What I'm trying to do is to restrict my moment-picker till the previous month.For this, I'm setting the data-max-date in HTML to moment().subtract(1,"M").format("MMM-YYYY") through JS controller. Also, in my JS service class, I've enabled the elements to be pre-populated with the previous month. But, after form submission, even though the previous month is enabled in moment-picker, selecting that is giving me a ng-invalid-max error. Unfortunately the code isn't mine to share. I hope I've made the facts clear. Your thoughts on the matter will be a great help.

Cheers!