-
Notifications
You must be signed in to change notification settings - Fork 4k
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(module:date-picker): support parse input value #4833
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4833 +/- ##
=========================================
Coverage ? 93.03%
=========================================
Files ? 506
Lines ? 12734
Branches ? 1967
=========================================
Hits ? 11847
Misses ? 470
Partials ? 417
Continue to review full report at Codecov.
|
bdc5505
to
100f1ed
Compare
10d594a
to
8cd44d2
Compare
Codecov Report
@@ Coverage Diff @@
## master #4833 +/- ##
==========================================
+ Coverage 91.45% 91.56% +0.10%
==========================================
Files 542 543 +1
Lines 13673 13688 +15
Branches 2033 2029 -4
==========================================
+ Hits 12505 12533 +28
+ Misses 699 693 -6
+ Partials 469 462 -7
Continue to review full report at Codecov.
|
c7324b1
to
df75b5a
Compare
Hi, with which new version will this fix be delivered? thanks |
9.0.0-beta.1 |
* feat(module:date-picker): support parse input value * test: fix tests * chore: support datefnsCompat option * fix: not import from i18n in core * chore: change API name and add docs * chore: change format convert from config to token * docs: update docs * chore: move some types * docs: update docs for date-fns update * chore: change name and add warning * docs: update docs Close NG-ZORRO#4028 Close NG-ZORRO#3976 Close NG-ZORRO#2492 Close NG-ZORRO#4101
* feat(module:date-picker): support parse input value * test: fix tests * chore: support datefnsCompat option * fix: not import from i18n in core * chore: change API name and add docs * chore: change format convert from config to token * docs: update docs * chore: move some types * docs: update docs for date-fns update * chore: change name and add warning * docs: update docs Close NG-ZORRO#4028 Close NG-ZORRO#3976 Close NG-ZORRO#2492 Close NG-ZORRO#4101
Close #4028
Close #3976
Close #2492
Close #4101
新功能
date-fns 1.x 不支持日期的反格式化,相关 issue 有:#4028 #3976 #2492 #4101。
date-fnx 2.x 已支持该功能。
date-fns 1.x does not support date parsing. Related issues are: #4028 #3976 #2492 #4101. date-fnx 2.x already supports [this feature] (https://date-fns.org/v2.9.0/docs/parse)
如何实现
由于 angular 的日期格式与 date-fns 的日期格式并不兼容。因此反格式化功能只有在用户引入了 date-fns 才能使用。
Since angular's date format and date-fns' date format are not compatible. Therefore, the parsing feature could only be supported when the user provides date-fns.
Breaking Change
我们推荐用户使用 date-fns 2.x 的新的 format 格式。同时也提供配置项将 1.x format 转为 2.x format,新旧 format 的对比参照这里。
We recommend that users use the new format of date-fns 2.x, and we also provide configuration items to convert 1.x format to 2.x format. For a comparison of the old and new formats, refer to here.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information