From ac04d10fe9d82366871bfb9ce4681e2f5e028490 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Fri, 9 Sep 2022 14:10:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(date-picker):=20=E4=BF=AE=E5=A4=8D=E8=8A=82?= =?UTF-8?q?=E6=B0=94=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/date-picker/src/components/calendar.tsx | 6 ++++-- packages/ui/date-picker/src/types.ts | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/ui/date-picker/src/components/calendar.tsx b/packages/ui/date-picker/src/components/calendar.tsx index c30a40fb4..08653d9b1 100644 --- a/packages/ui/date-picker/src/components/calendar.tsx +++ b/packages/ui/date-picker/src/components/calendar.tsx @@ -220,6 +220,7 @@ const Calendar = ({ altCalendarPresetData, dateMarkPresetData, }) as FormatCalendarItem + return ( {fullTimeInfo.nodeMark && ( @@ -235,7 +236,7 @@ const Calendar = ({ {fullTimeInfo.nodeMark} )} - {fullTimeInfo.text ? ( + {fullTimeInfo.text || fullTimeInfo.name ? ( { altCalendarPreset === 'id-ID' && showHolidayDetail(fullTimeInfo) @@ -250,7 +251,8 @@ const Calendar = ({ fullTimeInfo.highlight ? `${prefixCls}__lunar--highlight` : '' }`} > - {fullTimeInfo.text} + {/* 如果是节气,使用 fullTimeInfo.name */} + {fullTimeInfo.name || fullTimeInfo.text} ) : null} diff --git a/packages/ui/date-picker/src/types.ts b/packages/ui/date-picker/src/types.ts index 5ea13fc8f..8483860e3 100644 --- a/packages/ui/date-picker/src/types.ts +++ b/packages/ui/date-picker/src/types.ts @@ -49,7 +49,10 @@ export interface FormatCalendarItem { * 节点标记 */ nodeMark?: React.ReactNode - + /** + * 节气名称 + */ + name?: string FullText?: string }