As someone who is just starting out with Angular and Angular Material, I have encountered an issue regarding zonedDate format for dates in my backend.
The backend requires dates to be in zonedDate Format like this: 2018-04-11T02:12:04.455Z[UTC]. However, when I receive values in this format, they do not bind to the mat-datepicker component.
Here is the HTML code snippet causing the problem:
<mat-form-field class="fx-cell-1" floatLabel="never">
<input matInput name="myDate" [matDatepicker]="myDate" placeholder="Date of Expense"
[(ngModel)]="myDate" #myDate="ngModel" [max]="maxDate" required >
<mat-datepicker-toggle matSuffix [for]="myDate"></mat-datepicker-toggle>
<mat-datepicker #myDate></mat-datepicker>
</mat-form-field>
Upon further investigation, I noticed that the date "2018-04-11T02:12:04.455Z[UTC]" successfully binds to the datepicker, while "2018-04-02T14:00Z[UTC]" does not.
Any suggestions on how to resolve this issue?