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

Commit

Permalink
Merge pull request #91 from thanasis00/fix/disabledDays-minDate
Browse files Browse the repository at this point in the history
added length check for this.props.daysOfWeekDisabled
  • Loading branch information
chollier committed Sep 7, 2015
2 parents ced96f4 + 9b92b94 commit ac8d08e
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

1 comment on commit ac8d08e

@TSMMark
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chollier Is this released in version 0.0.20 on npm? minDate appears to be broken in 0.0.20.

Also please consider merging pull #97 ASAP, as it fixes a bug where minDate/maxDate conflict with daysOfWeekDisabled.

Please sign in to comment.