I am currently facing an issue with the date format generated by the angular material datepicker...
Wed Nov 21 2018 00:00:00 GMT+0530 (India Standard Time)
My requirement is to receive the date in either (YYYY-MM-DD)
or (YYYY-MM-DDTHH:mm)
format.
Here is the model class I am utilizing to store data from the angular material form:
export class FlightSchedule {
constructor(
public destination: string,
public origin: string,
public date: string,
public limit: string
) {}
}
I'm seeking assistance on how to convert the date into the desired YYYY-MM-DD
or YYYY-MM-DDTHH:mm
format.
As a beginner in Angular, any help would be greatly appreciated. Thank you!