|
|
@ -136,19 +136,6 @@ |
|
|
|
var id = id; |
|
|
|
var id = id; |
|
|
|
var now = new Date(); |
|
|
|
var now = new Date(); |
|
|
|
$calender.zabuto_calendar({ |
|
|
|
$calender.zabuto_calendar({ |
|
|
|
data: [ |
|
|
|
|
|
|
|
@foreach($educationAppointments as $appointment) |
|
|
|
|
|
|
|
@php |
|
|
|
|
|
|
|
$date = Carbon\Carbon::createFromFormat('Y-m-d', $appointment->date); |
|
|
|
|
|
|
|
$start_time = Carbon\Carbon::createFromFormat('H:i A', $appointment->start_time); |
|
|
|
|
|
|
|
$end_time = Carbon\Carbon::createFromFormat('H:i A', $appointment->end_time); |
|
|
|
|
|
|
|
@endphp |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
date: "{{ $date->format('Y-m-d') }}", |
|
|
|
|
|
|
|
content: "{{ $start_time->format('H:i') }} - {{ $end_time->format('H:i') }}" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@endforeach |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
classname: 'table event-colourful table-bordered lightgrey-weekends', |
|
|
|
classname: 'table event-colourful table-bordered lightgrey-weekends', |
|
|
|
week_starts: 'monday', |
|
|
|
week_starts: 'monday', |
|
|
|
show_days: true, |
|
|
|
show_days: true, |
|
|
@ -170,6 +157,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let allBtns = document.querySelectorAll("td") |
|
|
|
$calender.on('zabuto:calendar:day', function (e) { |
|
|
|
$calender.on('zabuto:calendar:day', function (e) { |
|
|
|
var now = new Date(); |
|
|
|
var now = new Date(); |
|
|
|
var date = e.date; |
|
|
|
var date = e.date; |
|
|
@ -192,14 +180,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// On click, remove the MyClass on ALL td |
|
|
|
|
|
|
|
allBtns.forEach(function(el){ |
|
|
|
|
|
|
|
el.classList.remove("active"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (e.today) { |
|
|
|
// Add the class on clicked one |
|
|
|
$(e.element).html('<span class="badge bg-success">'+ e.date.getDate() +'</span>'); |
|
|
|
e.target.classList.add("active"); |
|
|
|
} else if (e.date.getTime() < now.getTime()) { |
|
|
|
|
|
|
|
$(e.element).html('<span class="badge bg-danger">'+ e.date.getDate() +'</span>'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$(e.element).html('<span class="badge bg-success">'+ e.date.getDate() +'</span>'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
function dispalyAppointments(appointments,formated_date,id) { |
|
|
|
function dispalyAppointments(appointments,formated_date,id) { |
|
|
|