From 2eb553575396255eda1eb520739de3b0550e6a9b Mon Sep 17 00:00:00 2001 From: Elborn Chan Date: Sat, 12 Jul 2025 12:40:23 +0800 Subject: [PATCH] Fix #8052 year not updated with viewDate changes --- components/lib/calendar/Calendar.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/lib/calendar/Calendar.js b/components/lib/calendar/Calendar.js index 564073bf32..a65f4cb99e 100644 --- a/components/lib/calendar/Calendar.js +++ b/components/lib/calendar/Calendar.js @@ -3390,7 +3390,6 @@ export const Calendar = React.memo( const createTitleYearElement = (metaYear) => { const viewDate = getViewDate(); const viewYear = viewDate.getFullYear(); - const displayYear = props.numberOfMonths > 1 || props.yearNavigator ? metaYear : currentYear; if (props.yearNavigator) { let yearOptions = []; @@ -3416,7 +3415,7 @@ export const Calendar = React.memo( { className: cx('select'), onChange: (e) => onYearDropdownChange(e, e.target.value), - value: displayYear + value: metaYear }, ptm('select') ); @@ -3468,7 +3467,7 @@ export const Calendar = React.memo( ptm('yearTitle') ); - return currentView !== 'year' && ; + return currentView !== 'year' && ; }; const createTitleDecadeElement = () => {