-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 parsing input value #4346
Conversation
Deploy preview for ng-zorro-master ready! Built with commit 512c85f |
Codecov Report
@@ Coverage Diff @@
## master #4346 +/- ##
=========================================
+ Coverage 93.21% 93.31% +0.1%
=========================================
Files 521 521
Lines 12814 12815 +1
Branches 2018 2011 -7
=========================================
+ Hits 11944 11958 +14
+ Misses 454 450 -4
+ Partials 416 407 -9
Continue to review full report at Codecov.
|
5966f4c
to
512c85f
Compare
@wenqi73 Any updates on this PR? we're waiting for the release of these changes. |
@daxilsshah We are evaluating the breaking changes this feature and will give some feedback here. |
this.cdr.markForCheck(); | ||
} | ||
|
||
protected setFormat(): void {} |
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.
abstract
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.
用了 implements
后就不能用 abstract
了。
@@ -21,6 +21,6 @@ import { Component } from '@angular/core'; | |||
] | |||
}) | |||
export class NzDemoDatePickerFormatComponent { | |||
dateFormat = 'yyyy/MM/dd'; | |||
monthFormat = 'yyyy/MM'; | |||
dateFormat = 'dd.MM.yyyy'; |
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.
demo 可以不变吗?
Hello, what about this fix, do you need help? And is-it possible to add a mask on the input ? thanks a lot |
chore: use parseDate fn in datehelper
Very interested in this PR. |
See #4833 |
Close #4028
Close #3976
Close #2492
Close #4101
默认的日期格式使用国际化文件中的dateFormat
属性对应的值。新功能
date-fns 1.x 不支持日期的反格式化,相关 issue 有:#4028 #3976 #2492 #4101。
date-fnx 2.x 已支持该功能。
如何实现
由于 angular 的日期格式与 date-fns 的日期格式并不兼容。因此反格式化功能只有在用户引入了 date-fns 才能使用。
Breaking Change
Changelog: https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md#200---2019-08-20
我们建议用户同步 NG-ZORRO 升级到 2.x 版本。
PR Checklist
Please check if your PR fulfills the 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
API has changed, please merge in 9.0.0.