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

Commit

Permalink
added length check for this.props.daysOfWeekDisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tkatsadas committed Sep 3, 2015
1 parent ced96f4 commit 9b92b94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DateTimePickerDays.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class DateTimePickerDays extends Component {
if ((minDate && prevMonth.isBefore(minDate)) || (maxDate && prevMonth.isAfter(maxDate))) {
classes.disabled = true;
}
if (this.props.daysOfWeekDisabled) classes.disabled = this.props.daysOfWeekDisabled.indexOf(prevMonth.day()) !== -1;
if (this.props.daysOfWeekDisabled.length > 0) classes.disabled = this.props.daysOfWeekDisabled.indexOf(prevMonth.day()) !== -1;
cells.push(<td key={prevMonth.month() + "-" + prevMonth.date()} className={classnames(classes)} onClick={this.props.setSelectedDate}>{prevMonth.date()}</td>);
if (prevMonth.weekday() === moment().endOf("week").weekday()) {
row = <tr key={prevMonth.month() + "-" + prevMonth.date()}>{cells}</tr>;
Expand Down

0 comments on commit 9b92b94

Please sign in to comment.