-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Browser hangs when DatePicker's Input is bound to a function that returns Date translated from a string #6995
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
Comments
Tracking for use of ISO 8601 strings: #6265 (comment) Read here about setting up a date adapter to parse whatever you want in the mean time: #6773 Is it a requirement that your form model strictly uses strings? Why not just convert it to a date object once and pass that around instead? |
@willshowell Subscribed, Thanks a ton!
Implementing the DateAdapter that works with ISO8601 string as a single representation is cumbersome, but I am trying to do that now...
Yes, it is an [internal technical] requirement. It is VERY painful to deal with In JS we only use ephemeral I can not claim that most of the projects are following the same approach, but I believe that many do. Keeping in mind how painful dealing with |
@willshowell I am actually following this blog post. https://blog.angular.io/taking-advantage-of-the-angular-material-datepicker-237e80fa14b3 |
As a work in progress I got this (which is dependent on Please, see code in Gist: https://gist.github.com/another-guy/adc2d9d731af7693fdbfab21b1e227a9#file-iso8601datestringadapter-ts |
Tracking issue: #6265 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug:
input mdInput
'sngModel
bound to a function that returns a Date object "hangs" the page.What is the expected behavior?
The datepicker should display the date that represents the original date string.
What is the current behavior?
The browser page "hangs" (stack overflow likely).
What are the steps to reproduce?
https://plnkr.co/edit/icHhtOd4493dnc41uaY7?p=preview
If the component code is changed to the following, the browser page hangs:
What is the use-case or motivation for changing an existing behavior?
The model object has the dates in string format (ISO 8601 in real code), which should be the first class citizen just like
Date
.Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular-material beta10
The text was updated successfully, but these errors were encountered: