I'm trying to validate date. It does validate in most cases, but when I enter type number like 15042019, it does not show any error.
The problem is that custom validator I only gets null value or Date instance, so I don't have a chance to do some reqex matching:
<mat-form-field>
<input formControlName="ratingDate" matInput [matDatepicker]="picker1"
placeholder="Rating Date">
<mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker>
</mat-form-field>
this.formBuilder.group({
ratingDate: ['', CustomValidators.date],
});
How do I validate date inputs, in Reactive Forms, when using mat-datepicker?