@@ -63,7 +63,8 @@ var DateTimePickerDays = React.createClass({
6363 weeks = [ ] ,
6464 days = [ ] ,
6565 renderer = this . props . renderDay || this . renderDay ,
66- classes , disabled , dayProps
66+ isValid = this . props . isValidDate || this . isValidDate ,
67+ classes , disabled , dayProps , currentDate
6768 ;
6869
6970 // Go to the last week of the previous month
@@ -72,6 +73,7 @@ var DateTimePickerDays = React.createClass({
7273
7374 while ( prevMonth . isBefore ( lastDay ) ) {
7475 classes = 'day' ;
76+ currentDate = prevMonth . clone ( ) ;
7577
7678 if ( prevMonth . year ( ) < currentYear || prevMonth . month ( ) < currentMonth )
7779 classes += ' old' ;
@@ -84,7 +86,7 @@ var DateTimePickerDays = React.createClass({
8486 if ( prevMonth . isSame ( moment ( ) , 'day' ) )
8587 classes += ' today' ;
8688
87- disabled = minDate && prevMonth . isBefore ( minDate ) || maxDate && prevMonth . isAfter ( maxDate ) ;
89+ disabled = ! isValid ( currentDate , selected ) ;
8890 if ( disabled )
8991 classes += ' disabled' ;
9092
@@ -96,7 +98,7 @@ var DateTimePickerDays = React.createClass({
9698 if ( ! disabled )
9799 dayProps . onClick = this . props . updateDate ;
98100
99- days . push ( renderer ( dayProps , prevMonth . clone ( ) , selected ) ) ;
101+ days . push ( renderer ( dayProps , currentDate , selected ) ) ;
100102
101103 if ( days . length == 7 ) {
102104 weeks . push ( DOM . tr ( { key : prevMonth . format ( 'M_D' ) } , days ) ) ;
@@ -122,7 +124,8 @@ var DateTimePickerDays = React.createClass({
122124 DOM . td ( { onClick : this . props . showView ( 'time' ) , colSpan : 7 , className : 'timeToggle' } , this . props . selectedDate . format ( this . props . timeFormat ) )
123125 )
124126 ) ;
125- }
127+ } ,
128+ isValidDate : function ( ) { return 1 ; }
126129} ) ;
127130
128131module . exports = DateTimePickerDays ;
0 commit comments