Open micobarac opened 5 years ago
Any update on this issue?
It doesn't look difficult to solve.
Still hope this gets resolved. It looks ugly saying it is required when there is something in the input mat-datepicker.
It seems this is still an issue. It's showing an error saying my field is required when it just have the wrong format.
Reproduction
StackBlitz example:
https://stackblitz.com/edit/angular-x2g8lj?file=app%2Fdatepicker-overview-example.ts
Steps to reproduce:
jjj
date.errors.required
is alwaystrue
for any invalid, non-empty valueExpected Behavior
Like with any other Angular Material component, using
Validators.Required
,date.errors.required
should betrue
ONLY when the datepicker value is EMPTY!So, for any non-empty invalid value, instead of:
there should be:
Also, instead of:
there should be:
as a value of
date.errors
object.matDatepickerParse
is a strange concept. Using a custom datepicker validator should be allowed instead of it.Actual Behavior
For invalid non-empty values, this is the control errors object:
Environment