File tree 1 file changed +16
-4
lines changed
packages/react/src/components/DatePicker
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -383,10 +383,22 @@ export default class DatePicker extends Component {
383
383
}
384
384
}
385
385
386
- componentDidUpdate ( { dateFormat : prevDateFormat } ) {
387
- const { dateFormat } = this . props ;
388
- if ( this . cal && prevDateFormat !== dateFormat ) {
389
- this . cal . set ( { dateFormat } ) ;
386
+ componentDidUpdate ( {
387
+ dateFormat : prevDateFormat ,
388
+ minDate : prevMinDate ,
389
+ maxDate : prevMaxDate ,
390
+ } ) {
391
+ const { dateFormat, minDate, maxDate } = this . props ;
392
+ if ( this . cal ) {
393
+ if ( prevDateFormat !== dateFormat ) {
394
+ this . cal . set ( { dateFormat } ) ;
395
+ }
396
+ if ( prevMinDate !== minDate ) {
397
+ this . cal . set ( 'minDate' , minDate ) ;
398
+ }
399
+ if ( prevMaxDate !== maxDate ) {
400
+ this . cal . set ( 'maxDate' , maxDate ) ;
401
+ }
390
402
}
391
403
}
392
404
You can’t perform that action at this time.
0 commit comments