From 9b92b94bec6fc16b545554b6dfdcf3a559475fde Mon Sep 17 00:00:00 2001 From: Thanasis Katsadas Date: Thu, 3 Sep 2015 14:03:34 +0300 Subject: [PATCH] added length check for this.props.daysOfWeekDisabled --- src/DateTimePickerDays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DateTimePickerDays.js b/src/DateTimePickerDays.js index 13caf3d3..24e27614 100644 --- a/src/DateTimePickerDays.js +++ b/src/DateTimePickerDays.js @@ -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({prevMonth.date()}); if (prevMonth.weekday() === moment().endOf("week").weekday()) { row = {cells};