I have this calendar that i want to display the default value of user's previously input date. However it does not display any value when I try to change the date. New date is still being able to save so I'm curious how to fix the displaying on data change.
Here is the code for reference
<mat-form-field>
<input matInput [matDatepicker]="dp" placeholder="Date of Birth: No change Display" [formControl]="getDate(userPrivate.date_of_birth)" [(ngModel)]="userPrivate.date_of_birth">
<mat-datepicker-toggle matSuffix [for]="dp"></mat-datepicker-toggle>
<mat-datepicker #dp >
</mat-datepicker>
</mat-form-field>
and on my .ts
getDate(x){
// convert Epoch time to formcontrol
var date = new FormControl(new Date(parseInt(x)));
// return newDate;
return date;
}