I have this object:
data= {
date_code: '',
status_code: '',
date_order: '2017-08-04T18:30:00.000Z',
date_due: '2017-08-04T18:30:00.000Z',
date_dispatch: '2017-08-04T18:30:00.000Z',
};
And this function to perform submit data as json :
vm.onSubmit = function (data) {
const dateOrder = data["date_order"];
dateOrder = dateOrder.slice(0, 10);
data["date_order"] = dateOrder;
var json = JSON.stringify(data);
$scope.table.jsonData = json;
};
I want to get the value of "date_order" and store it to var for slice the date.
How can I do that in angularjs?