I have to check given value is matching with specific date format like "MM/dd/YYYY"
Ts file
onValChange(event: Date) {
const datePipe = new DatePipe('en-US');
const val = datePipe.transform(event, 'MM/dd/yyyy');
this.writeValue(moment(event));
}
Html file
<input class="form-control form-control-sm requiredV" [(ngModel)]="dateValue"
placeholder="mm/dd/yyyy" name="dateField" id="dateField" ngbDatepicker
#dateFieldngb="ngbDatepicker" [required]="isRequired"
[ngClass]="{'isUntouched':formName.submitted}" (ngModelChange)="onValChange($event)"
(keypress)="allow_only_numbers($event)" (click)="dateFieldngb.toggle()" />
Can you please tell me how to check entered value is matching with this specific format or not