Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Commit ac8d08e

Browse files
committed
Merge pull request #91 from thanasis00/fix/disabledDays-minDate
added length check for this.props.daysOfWeekDisabled
2 parents ced96f4 + 9b92b94 commit ac8d08e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DateTimePickerDays.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class DateTimePickerDays extends Component {
5656
if ((minDate && prevMonth.isBefore(minDate)) || (maxDate && prevMonth.isAfter(maxDate))) {
5757
classes.disabled = true;
5858
}
59-
if (this.props.daysOfWeekDisabled) classes.disabled = this.props.daysOfWeekDisabled.indexOf(prevMonth.day()) !== -1;
59+
if (this.props.daysOfWeekDisabled.length > 0) classes.disabled = this.props.daysOfWeekDisabled.indexOf(prevMonth.day()) !== -1;
6060
cells.push(<td key={prevMonth.month() + "-" + prevMonth.date()} className={classnames(classes)} onClick={this.props.setSelectedDate}>{prevMonth.date()}</td>);
6161
if (prevMonth.weekday() === moment().endOf("week").weekday()) {
6262
row = <tr key={prevMonth.month() + "-" + prevMonth.date()}>{cells}</tr>;

0 commit comments

Comments
 (0)