Skip to content

Commit

Permalink
Fix primefaces#6422: Calendar updateViewDate fix (primefaces#6425)
Browse files Browse the repository at this point in the history
* Fix#6422

* Update components/lib/calendar/Calendar.js

Co-authored-by: Melloware <[email protected]>

---------

Co-authored-by: Melloware <[email protected]>
  • Loading branch information
Rekl0w and melloware authored Apr 19, 2024
1 parent 6080b5e commit 4d4a214
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,13 @@ export const Calendar = React.memo(
setViewDateState(value);
}

setCurrentMonth(value.getMonth());
setCurrentYear(value.getFullYear());
if (value !== null) {
setCurrentMonth(value.getMonth());
setCurrentYear(value.getFullYear());
} else {
setCurrentMonth(null);
setCurrentYear(null);
}
};

const setNavigationState = (newViewDate) => {
Expand Down

0 comments on commit 4d4a214

Please sign in to comment.