-
-
Notifications
You must be signed in to change notification settings - Fork 50.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support date-fns in Picker #25822
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 808e373:
|
Codecov Report
@@ Coverage Diff @@
## feature #25822 +/- ##
========================================
Coverage 99.52% 99.52%
========================================
Files 374 374
Lines 7300 7300
Branches 2037 2037
========================================
Hits 7265 7265
Misses 35 35 Continue to review full report at Codecov.
|
docs/react/replace-moment.zh-CN.md
Outdated
@@ -5,7 +5,7 @@ title: 替换 Moment.js | |||
|
|||
## 如何在 DatePicker 中使用自定义日期库(如 dayjs )? | |||
|
|||
考虑到包的大小,你可以用自定义日期库替换 Moment。在这里我们提供了两种方式来实现替换: | |||
考虑到包的大小,你可以用自定义日期库(目前支持 dayjs、date-fns)替换 Moment。在这里我们提供了两种方式来实现替换: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
替换方式能类比么,从 datefns 导出的东西和 dayjs 一致?还有对 date-fns 的支持要加上版本提醒
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,是类似的,都是通过 generate 的方式去生成,这里有些细节我补一下。
docs/react/replace-moment.zh-CN.md
Outdated
@@ -5,7 +5,7 @@ title: 替换 Moment.js | |||
|
|||
## 如何在 DatePicker 中使用自定义日期库(如 dayjs )? | |||
|
|||
考虑到包的大小,你可以用自定义日期库替换 Moment。在这里我们提供了两种方式来实现替换: | |||
考虑到包的大小,你可以用自定义日期库(目前支持 dayjs、date-fns)替换 Moment。在这里我们提供了两种方式来实现替换: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
替换方式能类比么,从 datefns 导出的东西和 dayjs 一致?还有对 date-fns 的支持要加上版本提醒
新增了一下文档~可以CC |
docs/react/replace-moment.en-US.md
Outdated
|
||
### DatePicker.tsx | ||
|
||
Create `src/components/DatePicker.tsx`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文句号
docs/react/replace-moment.en-US.md
Outdated
@@ -5,7 +5,7 @@ title: Replace Moment.js | |||
|
|||
## How to use DatePicker with a custom date library like dayjs | |||
|
|||
Considering it's bundle size, you might want to replace Moment.js with a different date library of your choice. We provide two ways to customize which date library is used: | |||
Considering it's bundle size, you might want to replace Moment.js with a different date library(now support dayjs and date-fns) of your choice. We provide two ways to customize which date library is used: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering it's bundle size, you might want to replace Moment.js with a different date library(now support dayjs and date-fns) of your choice. We provide two ways to customize which date library is used: | |
Considering it's bundle size, you might want to replace Moment.js with a different date library (now support dayjs and date-fns) of your choice. We provide two ways to customize which date library is used: |
已经修改了~ |
@fireairforce 这个对应的依赖已经在主分支上更新了, |
@afc163 这个直接合到master吧? |
我用feature rebase 了一次 |
现在应该阔以了~ |
hello, |
Hello, |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
ref issue is:
#22732
#21866
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge
View rendered docs/react/replace-moment.en-US.md
View rendered docs/react/replace-moment.zh-CN.md