-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
md-datepicker throw exception #5417
Comments
@adoris If you are using |
@donroyco i am using angular/material 2.0.0-beta.7 with angular/core 4.2.4. but now also same issue |
@mmalerba sounds like there a situation that leads to trying to call |
@jelbourn I assume you didn't mean to close this? |
Yeah, clicked the wrong button |
I'm seeing the same thing, but only if I try to set a Min or Max on the input. |
@adoris @justingish can one of you please provide a plunker reproduction, this plunker seems to show it working correctly: http://plnkr.co/edit/iz3QNo4mBtjGYbWfo8ZU?p=preview |
Closing this as I cannot reproduce, if you are still seeing the issue feel free to provide a reproduction link and I will re-open. |
It was user error. I was binding the input to a string, not an actual date object. I am using reactive forms, if that makes a difference. However, I do believe there is room for improvement here because the Min and Max directives are behaving differently than the mdDatePicker. Binding to a string (eg... '2017-7-5) works just fine for the date picker control until you add a min or max directive to the control. I have created a plunker to show the issue: http://plnkr.co/edit/Iih5lyGbLO1p5pgriWZK?p=preview |
@justingish Thanks for the plunker, that does seem a little strange/inconsistent, reopening. |
I am also facing this error. My situation is when i bind it to a formControl in reactive forms. Error: No error: |
Error is still here using angular/material 2.0.0-beta.8 with angular/core 4.3.0. |
I have a PR open to make the behavior more consistent by also throwing errors when developers attempt to set the value to type other than the type expected by the |
That seems like a good fix. Plus the error message is clear so it will be simple to solve for anyone who mistakenly sends in a string rather than a date. |
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. |
What is the issue? *
Details:
HTML
ERROR
tested on:
The text was updated successfully, but these errors were encountered: