Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(input): correctly handle invalid model values for `input[date/time/…... #9375

Merged
merged 1 commit into from
Oct 1, 2014

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented Oct 1, 2014

...]`

Similar to input[number] Angular will throw if the model value
for a input[date] is not a Date object.
For Invalid Dates (dates who’s getTime() is NaN) input[date]
will render an empty string.

Closes #8949

@tbosch
Copy link
Contributor Author

tbosch commented Oct 1, 2014

@jeffbcross Could you review this?

@jeffbcross
Copy link
Contributor

@tbosch sure

@jeffbcross
Copy link
Contributor

LGTM, other than two nit-picks left on the commit

tbosch added a commit to tbosch/angular.js that referenced this pull request Oct 1, 2014
…e/…]`

Similar to `input[number]` Angular will throw if the model value
for a `input[date]` is not a `Date` object.
For `Invalid Date`s (dates whose `getTime()` is `NaN`) `input[date]` 
will render an empty string.

Closes angular#8949
Closes angular#9375
tbosch added a commit to tbosch/angular.js that referenced this pull request Oct 1, 2014
…e/…]`

Similar to `input[number]` Angular will throw if the model value
for a `input[date]` is not a `Date` object.
For `Invalid Date`s (dates whose `getTime()` is `NaN`) `input[date]` 
will render an empty string.

Closes angular#8949
Closes angular#9375
@tbosch
Copy link
Contributor Author

tbosch commented Oct 1, 2014

@jeffbcross Could you double check the error message (as a native speaker)

@jeffbcross
Copy link
Contributor

@tbosch Gladly, I will put on my native speaker hat.

@fullName Model is not a date object
@description

All date related inputs like `<input type="date">` require the model to be a `Date` object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have hyphen, "date-related"

@jeffbcross
Copy link
Contributor

One native speaker comment but otherwise LGTM.

…e/…]`

Similar to `input[number]` Angular will throw if the model value
for a `input[date]` is not a `Date` object.
For `Invalid Date`s (dates whose `getTime()` is `NaN`) `input[date]`
will render an empty string.

Closes angular#8949
Closes angular#9375
@tbosch
Copy link
Contributor Author

tbosch commented Oct 1, 2014

Ok, waiting for travis, then will merge.

@tbosch tbosch closed this Oct 1, 2014
@tbosch tbosch deleted the fix/invalidmodel branch October 1, 2014 23:37
@tbosch tbosch merged commit a0bfdd0 into angular:master Oct 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent handling of invalid initial ngModel values
3 participants