-
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
main-es2015.acca8c05bb7aa8144e3f.js:1 ERROR TypeError: this._value.setHours is not a function #4871
Labels
Comments
Will open a pull request for this. |
2 tasks
Created: #4872 |
Is this similar? #4777 |
Identical issue. |
3 tasks
hsuanxyz
pushed a commit
that referenced
this issue
Apr 1, 2020
Ricbet
pushed a commit
to Ricbet/ng-zorro-antd
that referenced
this issue
Apr 9, 2020
* fix(module:time-picker): allow inputting string type Fixes NG-ZORRO#4775, Fixes NG-ZORRO#4777, Fixed NG-ZORRO#4871, close NG-ZORRO#1679
Closed
hsuanxyz
pushed a commit
to hsuanxyz/ng-zorro-antd
that referenced
this issue
Aug 5, 2020
* fix(module:time-picker): allow inputting string type Fixes NG-ZORRO#4775, Fixes NG-ZORRO#4777, Fixed NG-ZORRO#4871, close NG-ZORRO#1679
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction link
https://stackblitz.com/edit/ng-zorro-antd-start-78vvuu
Steps to reproduce
What is expected?
Its expected to still work even date is passed as a string. This can create issues when dates are returned from API call as strings and not formatted to date beforehand, currently we need to format it always as date and then pass it to the component.
Time picker should IMO check if it is a string, and convert it to a date so it can use setHours methods etc
What is actually happening?
Time picker component is not converting it to a Date object and therefore throwing an error.
Ran into this bag when I was passing date value to the time picker.
After a API call, I passed date to time picker but it threw an error as API returned it as a string.
The text was updated successfully, but these errors were encountered: