Skip to content

Commit 62e84d4

Browse files
authored
Merge branch 'master' into checkbox-skeleton
2 parents 45ed96f + ef0752e commit 62e84d4

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

packages/react/src/components/DatePicker/DatePicker.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,22 @@ export default class DatePicker extends Component {
383383
}
384384
}
385385

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+
}
390402
}
391403
}
392404

0 commit comments

Comments
 (0)