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

input[type="date"] validity doesn't change when min/max change #6755

Closed
scottopherson opened this issue Mar 19, 2014 · 4 comments
Closed

input[type="date"] validity doesn't change when min/max change #6755

scottopherson opened this issue Mar 19, 2014 · 4 comments

Comments

@scottopherson
Copy link

While creating the jsfiddle example in my previous issue, I noticed that the validity of the date input doesn't get updated when the values of min/max change.

http://jsfiddle.net/va4kb/2/

Might just need a fix similar to: #6369

Edit:
Though, the validity of the date input does get updated if you make a change to the input after min/max are changed.

@scottopherson scottopherson changed the title input[type="date"] min/max as date objects input[type="date"] validity doesn't change when min/max change Mar 19, 2014
@lefos987 lefos987 added this to the Backlog milestone Mar 20, 2014
@btford btford removed the gh: issue label Aug 20, 2014
@matsko
Copy link
Contributor

matsko commented Aug 28, 2014

I've made some progress on this and my local code works for string-based date values (the first example in your demo). But the pure date object min/max value stuff doesn't work yet. I will resume the bug fix next week once I get someone to help me understand $interpolate (since that needs to be patched first).

@matsko matsko self-assigned this Aug 28, 2014
matsko added a commit to matsko/angular.js that referenced this issue Sep 3, 2014
matsko added a commit to matsko/angular.js that referenced this issue Sep 3, 2014
matsko added a commit to matsko/angular.js that referenced this issue Sep 4, 2014
matsko added a commit to matsko/angular.js that referenced this issue Sep 4, 2014
Due to the nature of how date objects are rendered when JSON.stringify
is called, the resulting string contains two sets of quotes surrounding
it. This commit fixes that issue.

Closes angular#6755
@matsko matsko closed this as completed in b350283 Sep 4, 2014
matsko added a commit that referenced this issue Sep 4, 2014
…inputs

Due to the nature of how date objects are rendered when JSON.stringify
is called, the resulting string contains two sets of quotes surrounding
it. This commit fixes that issue.

Closes #6755
@matsko
Copy link
Contributor

matsko commented Sep 4, 2014

This should now be working on master.

@matsko
Copy link
Contributor

matsko commented Sep 4, 2014

PS your example code should be max="{{ maxDt }}" and min="{{ minDt }}" (you forgot the curly brackets)

@matsko
Copy link
Contributor

matsko commented Sep 4, 2014

You're better off using ng-min and ng-max since the date won't be converted to string and back like what happens with min and max while using expressions.

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

Successfully merging a pull request may close this issue.

4 participants