Skip to content

Commit

Permalink
feat(date-picker): month-calendar should not use isDateDisabled funct…
Browse files Browse the repository at this point in the history
…ion for checking if entire month is disabled
  • Loading branch information
dethell committed Oct 5, 2023
1 parent 9ac334e commit e1339d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/date-picker/src/vaadin-lit-month-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolylitMixin(LitEle
}

if (props.has('month') || props.has('minDate') || props.has('maxDate') || props.has('isDateDisabled')) {
this.disabled = this._isDisabled(this.month, this.minDate, this.maxDate, this.isDateDisabled);
this.disabled = this._isDisabled(this.month, this.minDate, this.maxDate);
}

if (props.has('showWeekNumbers') || props.has('i18n')) {
Expand Down
4 changes: 2 additions & 2 deletions packages/date-picker/src/vaadin-month-calendar-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const MonthCalendarMixin = (superClass) =>
* Returns true if all the dates in the month are out of the allowed range
* @protected
*/
_isDisabled(month, minDate, maxDate, isDateDisabled) {
_isDisabled(month, minDate, maxDate) {
// First day of the month
const firstDate = new Date(0, 0);
firstDate.setFullYear(month.getFullYear());
Expand All @@ -156,7 +156,7 @@ export const MonthCalendarMixin = (superClass) =>
return false;
}

return !dateAllowed(firstDate, minDate, maxDate, isDateDisabled) && !dateAllowed(lastDate, minDate, maxDate, isDateDisabled);
return !dateAllowed(firstDate, minDate, maxDate) && !dateAllowed(lastDate, minDate, maxDate);
}

/** @protected */
Expand Down
2 changes: 1 addition & 1 deletion packages/date-picker/src/vaadin-month-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolymerElement)) {
disabled: {
type: Boolean,
reflectToAttribute: true,
computed: '_isDisabled(month, minDate, maxDate, isDateDisabled)',
computed: '_isDisabled(month, minDate, maxDate)',
},
};
}
Expand Down

0 comments on commit e1339d2

Please sign in to comment.