0
The code has an array that receives the information from DB. The date field receives the date in YYYY-MM-DD format, but I would like to display it in the following order DD-MM-YYYY.
Could you help me with some function or a hint on how to treat this problem?
for(var i=0;dados.length>i;i++){
$('#table').append(
"<td align = 'left' style='width:40px;max-width:40px;'<b>"+dados[i].Conta+"</b> </td>"+
"<td align = 'left' style='width:50px;max-width:50px;'><b>"+dados[i].codigoAcesso+"</b> </td>"+
"<td align = 'left' style='width:50px;max-width:50px;'><b>"+dados[i].nome+"</b> </td>"+
"<td align = 'left' style='width:50px;max-width:50px;'><b>"+dados[i].data+"</b> </td>"+
"</table>"
);
};
Thanks Caique! Although I deal with the same subject, my biggest difficulty is to take the date of the array and format it. That’s why I chose to create a new question.
– Riller Vincci
Take the array date is do
dados[i].data
, interpreting and formatting it is exactly what appears in the duplicate indicated by @Caiqueromero. It has N solutions, both manual and library– Isac