Skip to content

Commit 82374df

Browse files
committed
Syntax improvements, functional improvements
1 parent ff9852f commit 82374df

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/components/FunctionalCalendar.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,19 +384,22 @@
384384
classNames.push('wh_isMark_disabled');
385385
}
386386
387+
// Disable days of week if set in configuration
388+
let dayOfWeekString = this.fConfigs.dayNames[new Date(item.date).getDay()];
389+
390+
if (this.fConfigs.disabledDayNames.includes(dayOfWeekString)) {
391+
classNames.push('cursor-disallowed');
392+
classNames.push('wh_other_dayhide');
393+
}
394+
387395
return classNames;
388396
},
389397
clickDay: function (item) {
390398
391399
// Disable days of week if set in configuration
392-
let dayOfWeek = new Date(item.date).getDay();
393-
let dayOfWeekString = this.fConfigs.dayNames[dayOfWeek];
400+
let dayOfWeekString = this.fConfigs.dayNames[new Date(item.date).getDay()];
394401
395402
if (this.fConfigs.disabledDayNames.includes(dayOfWeekString)) {
396-
this.$emit('disabledDayClicked', {
397-
'dayOfWeekString': dayOfWeekString,
398-
'dayOfWeek': dayOfWeek,
399-
});
400403
return false;
401404
}
402405

0 commit comments

Comments
 (0)