Skip to content

Commit b933ede

Browse files
committed
fix(month): calculate enable dates within min-date and max-date
1 parent 81d3db9 commit b933ede

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/core/month.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ export default {
114114
115115
const days = [];
116116
117+
const minDate = this.minDate ? dayjs(this.minDate).startOf('day') : null;
118+
const maxDate = this.maxDate ? dayjs(this.maxDate).endOf('day') : null;
119+
117120
while (date.isBefore(end)) {
118121
const dayKey = date.format('YYYY/MM/DD');
119-
if ((this.minDate && date.isBefore(this.minDate, 'day'))
120-
|| (this.maxDate && date.isAfter(this.maxDate, 'day'))
122+
if ((minDate && date.isBefore(minDate))
123+
|| (maxDate && date.isAfter(maxDate))
121124
|| (date.month() !== activeMonth)) {
122125
days.push({
123126
disabled: true,

0 commit comments

Comments
 (0)