Skip to content

Commit

Permalink
fix(date-picker): 修复format传入函数,只有在type='weekrange'下生效问题(XiaoMi#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiamiao committed May 14, 2024
1 parent 5fdea15 commit 8ee3667
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ui/date-picker/src/components/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ const Input = ({
vals = vals?.toLocaleUpperCase()
}

if (typeof format === 'function' && date) {
vals = format(date)
}

setValue(vals)

cacheValues.current = vals
Expand Down

0 comments on commit 8ee3667

Please sign in to comment.