Skip to content

Commit

Permalink
Merge pull request #6447 from Rekl0w/Fix#6445
Browse files Browse the repository at this point in the history
Fix #6445: Calendar updateViewDate fix
  • Loading branch information
nitrogenous authored Apr 29, 2024
2 parents ab65745 + 49f1ecb commit c9eea79
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,12 +1057,16 @@ export const Calendar = React.memo(
setViewDateState(value);
}

if (!value) {
onClearButtonClick(event);
}

if (value !== null) {
setCurrentMonth(value.getMonth());
setCurrentYear(value.getFullYear());
} else {
setCurrentMonth(null);
setCurrentYear(null);
const day = value.getDate();
const month = value.getMonth();
const year = value.getFullYear();

onDateSelect(event, { day, month, year, selectable: isSelectable(day, month, year) });
}
};

Expand Down

0 comments on commit c9eea79

Please sign in to comment.