Skip to content

Instantly share code, notes, and snippets.

@giovanisilveira
Last active August 19, 2016 13:40
Show Gist options
  • Save giovanisilveira/713d75feef55af96dc2728e83365dedd to your computer and use it in GitHub Desktop.
Save giovanisilveira/713d75feef55af96dc2728e83365dedd to your computer and use it in GitHub Desktop.
var dados = {
"agendamentos": [
{
"id_tecnico": "258",
"nome": "Ledson Ferreira Oliveira",
"atendimento": "401838",
"data_hora": "2016-05-12 08:30:33",
},
{
"id": "94090",
"id_tecnico": "258",
"nome": "Ledson Ferreira Oliveira",
"atendimento": "161848",
"data_hora": "2016-05-12 08:30:33",
},
{
"id": "94091",
"id_tecnico": "258",
"nome": "Ledson Ferreira Oliveira",
"atendimento": "116345",
"data_hora": "2016-05-12 08:30:33",
},
{
"id": "94092",
"id_tecnico": "258",
"nome": "Ledson Ferreira Oliveira",
"atendimento": "232732",
"data_hora": "2016-05-12 08:30:33",
} ]
};
function showWithDate(atend) {
var d = new Date();
var data = d.getDate() + '/' + (d.getMonth()+1) + '/' + d.getFullYear();
setTimeout(function(){
console.log(data + " - " + atend);
}, 500);
}
function show(atend) {
console.log(atend);
}
$(dados.agendamentos).each(function(i, j){
show(j.atendimento);
showWithDate(j.atendimento);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment