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

Angular material date picker not able to update ng-model value on keyboard change in IE #7456

Closed
AshwanKumar opened this issue Mar 8, 2016 · 2 comments
Assignees
Labels
has: Pull Request A PR has been created to address this issue P1: urgent Urgent issues that should be addressed in the next minor or patch release.
Milestone

Comments

@AshwanKumar
Copy link

Hi Team,

We are using angular material components in our project and for having customized dates we used angular material date picker and found that in IE when user manually changes the date using keyboard the ng-model value doesn't get updated, I have even checked with angular site and same problem exists in site as well.

Here is the screenshot of above mentioned problem.
untitled

As you have seen in screen shot I have changed the year to 2015 but still the calender shows march 2016 only and ng-model still holds 8th march 2016 as a value.

Kindly please help us in above mentioned issue.

Regards,
Ashwan Kumar Siddireddi
[email protected]

@topherfangio topherfangio added the P1: urgent Urgent issues that should be addressed in the next minor or patch release. label Mar 17, 2016
@crisbeto crisbeto assigned crisbeto and unassigned EladBezalel Mar 22, 2016
@crisbeto crisbeto added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Mar 23, 2016
@crisbeto
Copy link
Member

The cause for this one is that the browser can parse dates in the format MM/DD/YYYY, but not DD/MM/YYYY. If your locale happens to use the second one, it gets considered invalid. This is because the initial value on the input gets set via toLocaleDateString.

@ThomasBurleson ThomasBurleson modified the milestones: Backlog, 1.1.0 Apr 20, 2016
crisbeto added a commit to crisbeto/material that referenced this issue Apr 21, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date`, the datepicker would have inserted an invalid date.
This change switches to always using the US date format, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456.
crisbeto added a commit to crisbeto/material that referenced this issue Apr 21, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456.
crisbeto added a commit to crisbeto/material that referenced this issue Apr 21, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456.
@crisbeto crisbeto added has: Pull Request A PR has been created to address this issue and removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs labels Apr 21, 2016
crisbeto added a commit to crisbeto/material that referenced this issue Apr 21, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456, angular#7404.
crisbeto added a commit to crisbeto/material that referenced this issue Apr 29, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456, angular#7404, angular#8275.
@ThomasBurleson ThomasBurleson modified the milestones: 1.1.0, Deprecated May 26, 2016
crisbeto added a commit to crisbeto/material that referenced this issue Jun 1, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456, angular#7404, angular#8275.
crisbeto added a commit to crisbeto/material that referenced this issue Jun 1, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes angular#7456.
Fixes angular#7404.
Fixes angular#8275.
@ThomasBurleson
Copy link
Contributor

This issue is closed as part of our ‘Surge Focus on Material 2' efforts.
For details, see our forum posting @ http://bit.ly/1UhZyWs.

ThomasBurleson pushed a commit that referenced this issue Jun 3, 2016
By default the datepicker would insert the date into the view after passing it through toLocaleDateString.
This means that if the user's locale date string couldn't be parsed by `new Date` (e.g. their locale is European which formats the dates as DD/MM/YYYY), the datepicker would have inserted an invalid date.
This change switches to using the US date format by default, because it is parse-able by the Date constructor. This shouldn't be unexpected, because the documentation states that users should override the date functions if they're dealing with different kinds of date formats.

Fixes #7456. Fixes #7404. Fixes #8275. Closes #8162
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P1: urgent Urgent issues that should be addressed in the next minor or patch release.
Projects
None yet
Development

No branches or pull requests

5 participants