Делал такое в Material data picker
https://material.angular.io/components/datepicker
в компоненте
import {
DateAdapter, MAT_DATE_FORMATS, MAT_DIALOG_DATA, MatDateFormats, MatDialog,
MatDialogRef
} from '@angular/material';
export const MOMENT_DATE_FORMATS: MatDateFormats = {
parse: {
dateInput: 'DD.MM.YYYY',
},
display: {
dateInput: 'DD.MM.YYYY',
monthYearLabel: 'MMMM Y',
dateA11yLabel: 'LL',
monthYearA11yLabel: 'MMMM Y'
}
};
Инпут
<mat-form-field class="px-20" fxFill>
<input
[(ngModel)]="children.date_birth" [ngModelOptions]="{standalone: true}"
matInput [matDatepicker]="date_birth"
(focus)="date_birth.open()"
(click)="date_birth.open()"
placeholder="Date birth">
<mat-datepicker-toggle matSuffix [for]="date_birth"></mat-datepicker-toggle>
<mat-datepicker #date_birth></mat-datepicker>
</mat-form-field>