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

Wrong disabled class on years with min-date, max-date settings #270

Open csimpi opened 5 years ago

csimpi commented 5 years ago

1999 is disabled despite the date range:

image

Prev page, 1999 is enabled but 1989 is disabled. It seems every first and last year is disabled without any reason:

image

csimpi commented 5 years ago

Update, I changed this line !selectable || [0, 11].indexOf(y) >= 0 ? 'disabled' : utility_1.isValidMoment(this.$ctrl.$modelValue) && year.isSame(this.$ctrl.$modelValue, 'year') ? 'selected' : '' to this: !selectable ? 'disabled' : utility_1.isValidMoment(this.$ctrl.$modelValue) && year.isSame(this.$ctrl.$modelValue, 'year') ? 'selected' : ''

in the DecadeView.prototype.render() runction

Basically I removed this condition: || [0, 11].indexOf(y) >= 0

I don't know if it has any goal let me know if I misunderstood something. Thx