Skip to content

Commit

Permalink
Fix primefaces#4456: Calendar showMinMaxRange NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed May 27, 2023
1 parent 281b300 commit bee7bd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ export const Calendar = React.memo(
};

const setNavigationState = (newViewDate) => {
if (!props.showMinMaxRange || props.view !== 'date' || !overlayRef.current) {
if (!newViewDate || !props.showMinMaxRange || props.view !== 'date' || !overlayRef.current) {
return;
}

Expand All @@ -972,7 +972,7 @@ export const Calendar = React.memo(
firstDayOfMonth.setMonth(11, 1);
firstDayOfMonth.setFullYear(firstDayOfMonth.getFullYear() - 1);
} else {
firstDayOfMonth.setMonth(firstDayOfMonth.getMonth() - 1, 1);
firstDayOfMonth.setMonth(firstDayOfMonth.getMonth(), 1);
}

firstDayOfMonth.setHours(0);
Expand Down

0 comments on commit bee7bd5

Please sign in to comment.