Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Datepicker #3732

Closed
isimonov opened this issue May 29, 2015 · 3 comments
Closed

Datepicker #3732

isimonov opened this issue May 29, 2015 · 3 comments

Comments

@isimonov
Copy link

If datepicker field set emty (for exemple, click "Clear" button in datepicker widget) in console write error: "Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date." and form (with datepicker) be is not valid ($scope.form.$valid is false). I think, that empty (null) value for date field is not error! It's wrong.

@rvanbaalen
Copy link
Contributor

Sorry, your reported issue is very hard to understand if you don't use some interpunction here and there.

What is exactly your problem? And can you please reproduce this in a plunkr? Without a plunkr, we won't start investigating the issue.

@isimonov
Copy link
Author

isimonov commented Jun 1, 2015

I'm sorry for the bad explanation. Again briefly.

First I open my form with the datepicker. The Datepicker is empty, all ok. Then I choose some date, all is well. Then I decide to leave this field blank, press 'Clear' button... and that's a problem. In the console I see the error "Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date." and my form with the date becomes invalid. It turns out that an empty value for a date field, this is a mistake. I think this is not right.

Plunker:
http://plnkr.co/edit/4SPYlJmb0LoNLoCMTCb8?p=preview

@rvanbaalen
Copy link
Contributor

Now I get it! Thanks for the explanation.

Also, your possible solution was also suggested here coincidentally: #3701 (comment)
This issue is a duplicate of #3701

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants