Very good companions, the problem I have is that I do not know how to do a cycle for
.
PURPOSE: Change the date format from timestamp to dd / mm / yyyy to
JSON
I tried this
this.dataTable.dataRows = response.data;
for (let date of this.dataTable.dataRows){
let date = moment(this.dataTable.dataRows.fecha.timestamp*1000).utc();
this.dataTable.dataRows.fecha=date.format('YYYY-MM-DD');
}
console.log(this.dataTable.dataRows);
The JSON
is:
{
"status": "success",
"code": "200",
"mensaje": "Todos los datos se han cargado correctamente",
"data": [
{
"idCorrDoc": 1,
"noResolucion": "15041-RES-CR-03925-2015",
"serie": "15DS000F",
"desde": 1,
"hasta": 7000,
"fecha": {
"timezone": {
"name": "UTC",
"transitions": [
{
"ts": -9223372036854775808,
"time": "-292277022657-01-27T08:29:52+0000",
"offset": 0,
"isdst": false,
"abbr": "UTC"
}
],
"location": {
"country_code": "??",
"latitude": 0,
"longitude": 0,
"comments": ""
}
},
"offset": 0,
"timestamp": 1422835200
},
"status": true,
"nomimprenta": "CREATIVA, S.A. DE C.V.",
"nitimprenta": "0614-231092-107-7",
"nrcimprenta": "72018-6",
}
]
}