I want to change the date format from dd/mm/yyyy to dd-mm-yyyy please look at the reference image once for clarity:
HTML
<div fxFlex="calc(25% - 30px)">
<mat-form-field appearance="outline" class="w-100">
<mat-label>Date of birth</mat-label>
<input matInput type="date" [formControlName]="'dateOfBirth'" placeholder="Select entry date" required>
<mat-error *ngIf="dateFormat">
<strong>Kindly enter a valid date</strong>
</mat-error>
</mat-form-field>
</div>
TS
dateFormat: boolean;
validateDate() {
if (this.memberForm.get('dateOfBirth').value == '') {
this.dateFormat = true;
}
}
ngOnInit() {
this.validateDate();
}