I got this type of json format after a get request:
{
"name" : "cow",
"date" : {
    "year" : 2012,
    "month" : "JANUARY",
    "dayOfMonth" : 1,
    "dayOfWeek" : "FRIDAY",
    "dayOfYear" : 1,
    "monthValue" : 1,
    "hour" : 2,
    "minute" : 2,
    "second" : 0,
    "nano" : 0,
    "chronology" : {
      "id" : "ISO",
      "calendarType" : "iso8601"
    }
  }
....
}
How can I convert the above to the following in typescript/angular:
{
"name" : "cow",
"date" : "2012-01-01"
}
Then store in the below array.
//....correctFormat = [];
service.convertStore()
  .subscribe((data: any) => {
    // manipulation here
    correctFormat = "holds result"
})
 
     
    