Skip to content
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:datepicker): support string and number type as value #593

Merged
merged 1 commit into from
Nov 26, 2017

Conversation

JuniorTour
Copy link
Contributor

@JuniorTour JuniorTour commented Nov 21, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

目前,datepicker组件仅仅支持Date类型和数字类型时间戳或字符类型时间戳的输入,其他类型的输入都会被处理成Invalid date

Issue Number: #123 ([feat] about nzDate #123), #121 (the value of DatePicker component is only just Date type? #121)

What is the new behavior?

修改后,该组件可以正确显示字符串类型的ISO 8601时间以及数字类型的时间戳,momentjs不支持的类型都会显示为Invalid Date,充分利用了momentjs的兼容能力,如下图所示。

zorro-datepipe-demo

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

change NzDatePipe to support display string type in valid ISO 8601 
format (eg: '2013-02-08 09:30:26.123') and number type (eg: 
timestamp-'123456789') .

修改了NzDatePipe从而支持显示输入的ISO 8601时间格式的字符串类型(如: “2013-02-08 09:30:26.123”)和数字类型(如:时间戳-“123456789”)。
@coveralls
Copy link

Coverage Status

Coverage remained the same at 41.842% when pulling a4ab4c0 on JuniorTour:patch-1 into c85111a on NG-ZORRO:master.

@vthinkxie vthinkxie merged commit aee7abe into NG-ZORRO:master Nov 26, 2017
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
…ZORRO#593)

change NzDatePipe to support display string type in valid ISO 8601 
format (eg: '2013-02-08 09:30:26.123') and number type (eg: 
timestamp-'123456789') .

修改了NzDatePipe从而支持显示输入的ISO 8601时间格式的字符串类型(如: “2013-02-08 09:30:26.123”)和数字类型(如:时间戳-“123456789”)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants