From dd87127593bdaedc4ecbab5ce72e8331a2236ff1 Mon Sep 17 00:00:00 2001 From: KumJungMin Date: Thu, 26 Sep 2024 20:17:12 +0900 Subject: [PATCH 1/2] fix: show current year when select year in month view --- components/lib/calendar/Calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/calendar/Calendar.js b/components/lib/calendar/Calendar.js index 46305132ff..951c3203ad 100644 --- a/components/lib/calendar/Calendar.js +++ b/components/lib/calendar/Calendar.js @@ -3342,7 +3342,7 @@ export const Calendar = React.memo( const createTitleYearElement = (metaYear) => { const viewDate = getViewDate(); const viewYear = viewDate.getFullYear(); - const displayYear = props.numberOfMonths > 1 ? metaYear : viewYear; + const displayYear = props.yearNavigator ? metaYear : currentYear; if (props.yearNavigator) { let yearOptions = []; From e803ad8c204acd79aad0cc61c51f92d54db95b60 Mon Sep 17 00:00:00 2001 From: KumJungMin Date: Thu, 26 Sep 2024 20:30:51 +0900 Subject: [PATCH 2/2] fix: show prev, currentYear at month view when numberOfMonths mode --- components/lib/calendar/Calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/calendar/Calendar.js b/components/lib/calendar/Calendar.js index 951c3203ad..c092dcc118 100644 --- a/components/lib/calendar/Calendar.js +++ b/components/lib/calendar/Calendar.js @@ -3342,7 +3342,7 @@ export const Calendar = React.memo( const createTitleYearElement = (metaYear) => { const viewDate = getViewDate(); const viewYear = viewDate.getFullYear(); - const displayYear = props.yearNavigator ? metaYear : currentYear; + const displayYear = props.numberOfMonths > 1 || props.yearNavigator ? metaYear : currentYear; if (props.yearNavigator) { let yearOptions = [];