Skip to content

Commit

Permalink
fix(date-picker): 修复节气显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Sep 9, 2022
1 parent d561f56 commit ac04d10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/ui/date-picker/src/components/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const Calendar = ({
altCalendarPresetData,
dateMarkPresetData,
}) as FormatCalendarItem

return (
<React.Fragment>
{fullTimeInfo.nodeMark && (
Expand All @@ -235,7 +236,7 @@ const Calendar = ({
{fullTimeInfo.nodeMark}
</div>
)}
{fullTimeInfo.text ? (
{fullTimeInfo.text || fullTimeInfo.name ? (
<span
onMouseEnter={() => {
altCalendarPreset === 'id-ID' && showHolidayDetail(fullTimeInfo)
Expand All @@ -250,7 +251,8 @@ const Calendar = ({
fullTimeInfo.highlight ? `${prefixCls}__lunar--highlight` : ''
}`}
>
{fullTimeInfo.text}
{/* 如果是节气,使用 fullTimeInfo.name */}
{fullTimeInfo.name || fullTimeInfo.text}
</span>
) : null}
</React.Fragment>
Expand Down
5 changes: 4 additions & 1 deletion packages/ui/date-picker/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export interface FormatCalendarItem {
* 节点标记
*/
nodeMark?: React.ReactNode

/**
* 节气名称
*/
name?: string
FullText?: string
}

Expand Down

0 comments on commit ac04d10

Please sign in to comment.