If you want to handle date parsing before setting it to your model, consider using the ngModelChange event in Angular. I suggest using momentJS for simple date manipulations.
Here's how you can implement it in your HTML:
<input [ngModel]="date" (ngModelChange)="onDataChange($event)" matInput [matDatepicker]="picker" placeholder="Choose a date">
In your Component.ts file:
onDataChange(newdate) {
const _ = moment();
const date = moment(newdate).add({hours: _.hour(), minutes:_.minute() , seconds:_.second()})
this.date = date.toDate();
console.log({hours: _.hour(), minutes:_.minute() , seconds:_.second()})
}
You can view the complete solution here: https://stackblitz.com/edit/angular-ecq2lc