You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keying in, for example, 2017-06-30 should result in June 30th 2017 being selected in the calendar popup..
What is the current behavior?
Examples:
Entering 2017-06-24 selects the 23rd
Entering 2017-6-08 selects the 7th
Entering 2017-06-08 selects the 7th
Entering 2017-6-8 works correctly
Entering 2017-06-8 works correctly
The problem only occurs when entry is in YYYY/MM/DD format and a 2-digit day is entered.
These other formats work correctly: mm-dd-yyyy (i.e. 6-30-2017) and dd-MMM-yyyy (i.e. 30-JUN-2017)
The NativeDateAdapter is currently only able to parse mm-dd-yyyy due to limitations of JavaScript's Date object. We do have plans to make NativeDateAdapter more robust once the new i18n API arrives in Angular core (#6030). We also plan to add DateAdapters for libraries like Moment.js which give more control over the parse format (#5972). Neither of these is ready yet, if you need a quick solution immediately, I recommend extending NatvieDateAdapter and overriding the parse method to meet your needs.
Closing since #6030 is already tracking improved parsing in NativeDateAdapter
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Keying in, for example, 2017-06-30 should result in June 30th 2017 being selected in the calendar popup..
What is the current behavior?
Examples:
Entering 2017-06-24 selects the 23rd
Entering 2017-6-08 selects the 7th
Entering 2017-06-08 selects the 7th
Entering 2017-6-8 works correctly
Entering 2017-06-8 works correctly
The problem only occurs when entry is in YYYY/MM/DD format and a 2-digit day is entered.
These other formats work correctly: mm-dd-yyyy (i.e. 6-30-2017) and dd-MMM-yyyy (i.e. 30-JUN-2017)
What are the steps to reproduce?
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Current version (Angular Material beta-8) at material.angular.io
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: