-
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:time-picker): support 12-hour with nzUse12Hours
#3127
feat(module:time-picker): support 12-hour with nzUse12Hours
#3127
Conversation
add unit test on feature `support 12-hour`
Codecov Report
@@ Coverage Diff @@
## master #3127 +/- ##
==========================================
+ Coverage 97.37% 97.45% +0.07%
==========================================
Files 559 559
Lines 11627 11733 +106
Branches 835 859 +24
==========================================
+ Hits 11322 11434 +112
+ Misses 193 189 -4
+ Partials 112 110 -2
Continue to review full report at Codecov.
|
Deploy preview for ng-zorro-master ready! Built with commit 4fc833e |
nzUse12Hours
nzUse12Hours
add test case in 12-hour feature in TimePicker
nzUse12Hours
nzUse12Hours
(#1513)
add unit test case on '12-hour' featrue
nzUse12Hours
(#1513)nzUse12Hours
Would not be better to handle it like “nzConvention=‘12’” and “nzConvention=‘24’”? |
To keep same with Ant Design of React |
add unit test case for 12-hour
…/ng-zorro-antd into feat/timePicker-support-12-hour
…/ng-zorro-antd into feat/timePicker-support-12-hour
nzUse12Hours
nzUse12Hours
@@ -201,6 +209,21 @@ export class NzTimePickerPanelComponent implements ControlValueAccessor, OnInit, | |||
return this._nzSecondStep; | |||
} | |||
|
|||
@Input() | |||
set nzUse12Hours(value: boolean) { |
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.
这里尽量不要使用getter/setter的方式,改用ngOnChanges中作变化检测吧
@@ -49,6 +49,7 @@ export class NzTimePickerPanelComponent implements ControlValueAccessor, OnInit, | |||
private _defaultOpenValue = new Date(); | |||
private _opened = false; | |||
private _allowEmpty = true; | |||
private _nzUse12Hours = false; |
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.
替换掉getter/setter方式后,应该只需要使用 nzUse12Hours
变量即可
Replace getter/setter with ngOnChanges to implement nzUse12Hours
1a2f2fe
to
913d314
Compare
Thank you @wilsoncook ! |
All thanks to @kekehaoz |
My mistake, thanks @kekehaoz !! |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
TimePicker support 12-hour
What is the current behavior?
Issue Number: #1513
What is the new behavior?
Does this PR introduce a breaking change?
Other information