0
I have a system hosted at UOL where I capture the data through a ajax
of my WebService
and the dates that are in the bank are in the format of DD/MM/AAAA
but when I return to the screen(HTML
) the dates are eventually converted to MM/DD/AAAAA
.
There’s a way I can always form in the form DD/MM/AAAAA
?
Follow the code @Lucas Costa
I seek information from WS
Try{
//Request on Server
$. ajax({
type: "POST",
url: method,
data: JSON.stringify(parameters),
beforeSend: function(){
loading.css('visibility', 'visible'); // exibe o div
},
complete: function(){
loading.css('visibility', 'hidden'); // esconde o div
divLoading.classList.remove('loading');
divLoading.innerHTML = '';
},
cache: false,
contentType: "application/json", //; charset=utf-8",
dataType: "json",
success: function (resposta) {
if (resposta.d !== null && resposta.d !== "") {
pagina = 0;
dados = resposta.d;
}
**Then I populate my table
for (var i = 0; i < data.length; i++){
cont ++;
tbody.append(
$("")
.append($("<td title='Status de viagem: " + dados[i].DscStatus + "'>")
.append("<button type='button' "+
"class='btn btn-default btn-sm' onclick='javascript: AbrirRegistroDadosVaigem(" + dados[i].NroViagem + ");'> "+
"<span class='glyphicon glyphicon-road' style='color:" + dados[i].CorStatus +";'></span></button>"))
.append($("<td>").append("<button type='button' class='btn btn-primary btn-sm' data-toggle='modal' data-target='#myCheckList'" +
" onclick='javascript: AbrirCheckList(" + dados[i].NroViagem + ");'> " +
"<span class='glyphicon glyphicon-list'></span></button>"))
.append($("<td>").append("<button type='button' class='btn btn-primary btn-sm' " +
" onclick='javascript: AbrirRegistroFup(" + dados[i].NroViagem + ");'> " +
"<span class='glyphicon glyphicon-envelope badge'> " + dados[i].QtdFup + " </span></button>"))
.append($("<td>").append("<input type='checkbox' value=''>"))
.append($("<td>").append(dados[i].DataColeta))
.append($("<td>").append(dados[i].DataEntrega))
And the problem is the Date Collection and Date Delivery fields that are now DD/MM/YYYY and sometimes MM/DD/YYYY
Could include code instead of image?
– BrTkCa