I need to format date to display on the grid, but I do not know the best way to do that.
I'm doing it this way:
$scope.formato[x].dataFormatada = formatDate($scope.consultas[x].data);
function formatDate(date){
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
date = day + "/" + month + "/" + date.getFullYear();
return date;
}
In HTML that mounts the grid, I have a tg tag with ng-repeat to get the data and put it inside the td tag:
<td>{{consulta.dataFormatada}}</td>
And I have another question too ... how do I not send this $ scope.consulta.dataFormatada in a request? I used $ delete, but then the data disappears from the grid.