-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Reproduction
Use StackBlitz to reproduce your issue:
https://stackblitz.com/edit/angular-qn3txm
Steps to reproduce:
- Strict mode for moment adapter is turned on in app.module providers section
- valuechanges is set up at the form
- When user starts typing in date, for instance types in "10" and stops, the valuechanges should fire with the value of Moment date object being invalid (invalid: true).
- Currently it fires with the Moment date value being expanded to 10/01/2019, making it valid date. Now, this could be ok behaviour prior we had the strict mode or when strict mode is off but not when it is turned on.
Expected Behavior
For incomplete dates entered into the form the Datepicker/Moment date adapter currently works in a way of "autocompleting" the value to the current month, which is unwanted when strict mode in turned on.
Actual Behavior
If user enters "10" currently the datepicker/dateadapter expands it to 10/1/2019 (for default en-us locale being in use). Even when strict mode is on.
What behavior were you expecting to see?
The Moment value from the datepicker value should be invalid (or maybe null).
Environment
- Angular: 8.2.8
- CDK/Material: 8.2.1
- Browser(s): latest chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
Metadata
Metadata
Assignees
Labels
No labels