1
I need to format date to present on the grid, but I don’t know the best way to do this.
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 the HTML that mounts the grid, I have a Tg tag with ng-repeat to take the data and put inside the td tag:
<td>{{consulta.dataFormatada}}</td>
And I have another question too... how do I not send this $Scope.consulta.dataFormated on a request? I used $delete, but then the data disappears from the grid.
I recommend using Jquery Mask, bring everything right to you the fields, try there that makes life much easier. There are several types beyond date. Link: http://vinteum.com/jquery-mask-mascaras-para-campos-html-utilizando-jquery/
– Bruno A. Klein