I have this snippet of code in my HTML file:
<ion-datetime [(ngModel)]="time" formControlName="time" displayFormat="hh:mm a"></ion-datetime>
I am trying to populate the ion datetime element with data retrieved from the server. The response from the HTTP request is in string format as follows:
10:00PM
In my TypeScript file, I am using the following code to fill the ion datetime element:
this.time = data.time;
Where data.time = '10:00PM'
Unfortunately, I keep getting an error that says "invalid ISO Format."
Can someone assist me with converting the time format '10:00PM' to ISO format so I can successfully populate the ion datetime element with the display format of 'hh:mm a'?
Your help is greatly appreciated. Thank you :)