Untitled Diff

24 lines
-3 Removals
26 lines
+5 Additions
success: function(data) {
success: function(data) {
let json = JSON.parse(data);
let json = JSON.parse(data);
const schedules = json["doctors"]["schedules"];
const schedules = json["doctors"]["schedules"];
for (let k = 0; k < json["doctors"].length; k++) {
for (let k = 0; k < json["doctors"].length; k++) {
for (let i = 0; i < json["doctors"][k]["schedules"].length; i++) {
for (let i = 0; i < json["doctors"][k]["schedules"].length; i++) {
const date = json["doctors"][k]["schedules"][i];
const date = json["doctors"][k]["schedules"][i];
console.log(date.date);
console.log(date.date);
$(".text-data").append($('<div>', {
$(".text-data").append($('<div>', {
'id': [i],
'class': "date",
'class': "date",
'text': date.date
'text': date.date
}));
}));
for (let j = 0; j < json["doctors"][k]["schedules"][i]["intervals"].length; j++) {
for (let j = 0; j < date["intervals"].length; j++) {
const interval = json["doctors"][k]["schedules"][i]["intervals"][j];
const interval = date["intervals"][j];
if(interval.free) {
if(interval.free) {
console.log(interval.start);
console.log(interval.start);
$(".date").append($('<div>', {
let iddate = "#" + [i];
$(iddate).append($('<div>', {
'class': "start",
'class': "start",
'text': interval.start
'text': interval.start
}));
}));
}
}
}}
}}
}}
}}
Editor
Clear
Export as PDF