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

TimePicker in ReactiveForms crashes when the input is a string representation of a Date. #4654

Closed
TheAifam5 opened this issue Jan 8, 2020 · 1 comment

Comments

@TheAifam5
Copy link

TheAifam5 commented Jan 8, 2020

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start-6psoqi

Steps to reproduce

  1. Create Reactive Form
  2. Add TimePicker with formControlName
  3. Set FormGroup data with patchValue, where the input for TimePicker is a string representation of a Date (new Date().toJSON())
  4. Click on TimePicker and pick something else.

What is expected?

Should convert the string to the Date

What is actually happening?

Tries to call Date related functions on a string, like getHour, getMinutes which leads to crash.

Environment Info
ng-zorro-antd 8.5.2
Browser Firefox Developer Edition, Chrome
@wenqi73
Copy link
Member

wenqi73 commented Apr 24, 2020

Fixed it by #4949.

@wenqi73 wenqi73 closed this as completed Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants