|
|
|
@ -136,19 +136,6 @@ |
|
|
|
|
var id = id; |
|
|
|
|
var now = new Date(); |
|
|
|
|
$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', |
|
|
|
|
week_starts: 'monday', |
|
|
|
|
show_days: true, |
|
|
|
@ -170,6 +157,7 @@ |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
let allBtns = document.querySelectorAll("td") |
|
|
|
|
$calender.on('zabuto:calendar:day', function (e) { |
|
|
|
|
var now = new Date(); |
|
|
|
|
var date = e.date; |
|
|
|
@ -192,14 +180,13 @@ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (e.today) { |
|
|
|
|
$(e.element).html('<span class="badge bg-success">'+ e.date.getDate() +'</span>'); |
|
|
|
|
} 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>'); |
|
|
|
|
} |
|
|
|
|
// On click, remove the MyClass on ALL td |
|
|
|
|
allBtns.forEach(function(el){ |
|
|
|
|
el.classList.remove("active"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Add the class on clicked one |
|
|
|
|
e.target.classList.add("active"); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
function dispalyAppointments(appointments,formated_date,id) { |
|
|
|
|