Skip to content

Commit 21862cc

Browse files
committed
fix minDate/maxDate fallback
1 parent b6e92e4 commit 21862cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Calendar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ class Calendar extends PureComponent {
162162
}
163163
renderMonthAndYear(focusedDate, changeShownDate, props) {
164164
const { showMonthArrow, locale, minDate, maxDate, showMonthAndYearPickers } = props;
165-
const upperYearLimit = maxDate.getFullYear();
166-
const lowerYearLimit = minDate.getFullYear();
165+
const upperYearLimit = (maxDate || Calendar.defaultProps.maxDate).getFullYear();
166+
const lowerYearLimit = (minDate || Calendar.defaultProps.minDate).getFullYear();
167167
const styles = this.styles;
168168
return (
169169
<div onMouseUp={e => e.stopPropagation()} className={styles.monthAndYearWrapper}>

0 commit comments

Comments
 (0)