I'm trying to decode a json that has date value inside the json is like this
{
"id": 2
"startDate": "2022-08-01T18:44:09.538",
"endDate": "2023-07-30T03:03:56.249",
"dateCreated": "2022-07-30T03:05:08.8338403"
}
and here is my struct model for the Json.
struct JsonResponse: Decodable, Identifiable {
var id: Int
var startDate: Date
var endDate: Date
var dateCreated: Date
}
My question is how can I decode these dates and show them in a Text() like "Mon 11/22" format. Thanks for your help.