@@ -132,15 +132,17 @@ class Calendar extends PureComponent {
132132 }
133133 }
134134 changeShownDate ( value , mode = 'set' ) {
135- const focusedDate = this . state . focusedDate ;
135+ const { focusedDate} = this . state ;
136+ const { onShownDateChange, minDate, maxDate} = this . props ;
136137 const modeMapper = {
137138 monthOffset : ( ) => addMonths ( focusedDate , value ) ,
138139 setMonth : ( ) => setMonth ( focusedDate , value ) ,
139140 setYear : ( ) => setYear ( focusedDate , value ) ,
140141 set : ( ) => value ,
141142 } ;
142- const newDate = min ( [ max ( [ modeMapper [ mode ] ( ) , this . props . minDate ] ) , this . props . maxDate ] ) ;
143+ const newDate = min ( [ max ( [ modeMapper [ mode ] ( ) , minDate ] ) , maxDate ] ) ;
143144 this . focusToDate ( newDate , this . props , false ) ;
145+ onShownDateChange && onShownDateChange ( newDate )
144146 }
145147 handleRangeFocusChange ( rangesIndex , rangeItemIndex ) {
146148 this . props . onRangeFocusChange && this . props . onRangeFocusChange ( [ rangesIndex , rangeItemIndex ] ) ;
@@ -470,6 +472,7 @@ Calendar.propTypes = {
470472 classNames : PropTypes . object ,
471473 locale : PropTypes . object ,
472474 shownDate : PropTypes . object ,
475+ onShownDateChange : PropTypes . func ,
473476 ranges : PropTypes . arrayOf ( rangeShape ) ,
474477 preview : PropTypes . shape ( {
475478 startDate : PropTypes . object ,
0 commit comments