Skip to content

Commit

Permalink
Merge pull request #2232 from XiaoMi/hotfix/#2217(V4)
Browse files Browse the repository at this point in the history
fix(date-picker): 修复节气显示问题
  • Loading branch information
solarjoker authored Sep 9, 2022
2 parents d561f56 + ac04d10 commit 2dca325
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 2dca325

Please sign in to comment.