I have a Datepicker input like this:
<mat-form-field class="example-full-width">
<input #startDate matInput [matDatepicker]="picker" (dateInput)="first($event.value)" placeholder="Enter date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
When the input changes, the first funtion receives the $event.value date in this format:
Tue Apr 09 2019 00:00:00 GMT+0200
And I need this one (AAAA-MM-DD):
2019-04-09
Is there any way to change the Datepicker's output value whitout parsing it by hand? Thanks.