Deje de usar cdn y mejore el calendario
This commit is contained in:
+20
-10
@@ -46,7 +46,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
},
|
||||
*/
|
||||
|
||||
eventClick: function(info) {
|
||||
eventClick: function (info) {
|
||||
|
||||
const evento = info.event
|
||||
|
||||
@@ -55,9 +55,18 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
modal.classList.remove("hidden")
|
||||
|
||||
const statusMap = {
|
||||
pending: 'Pendiente',
|
||||
confirmed: 'Confirmado',
|
||||
in_progress: 'En progreso',
|
||||
ready: 'Listo',
|
||||
delivered: 'Entregado'
|
||||
}
|
||||
|
||||
const estado = statusMap[evento.extendedProps.status] ?? 'desconocido'
|
||||
|
||||
document.getElementById("modalTitle").innerText =
|
||||
evento.extendedProps.description + " - " +
|
||||
evento.extendedProps.status
|
||||
evento.extendedProps.description + " - " + estado
|
||||
|
||||
const fecha = evento.start
|
||||
|
||||
@@ -68,21 +77,22 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
})
|
||||
|
||||
document.getElementById("modalDate").innerText =
|
||||
"Hora: " + hora
|
||||
|
||||
document.getElementById("viewEventBtn").href =
|
||||
"/appointments/" + evento.id
|
||||
"Hora: " + hora
|
||||
|
||||
const url = window.appointmentShowTemplate.replace(':id', evento.id)
|
||||
|
||||
document.getElementById("viewEventBtn").href = url
|
||||
},
|
||||
|
||||
events: window.appointments ?? [],
|
||||
|
||||
eventDidMount: function(info) {
|
||||
eventDidMount: function (info) {
|
||||
|
||||
const status = info.event.extendedProps.status
|
||||
|
||||
const colors = {
|
||||
pending: '#f59e0b',
|
||||
in_progress: '#ef4444',
|
||||
pending: '#ef4444',
|
||||
in_progress: '#f59e0b',
|
||||
completed: '#22c55e',
|
||||
ready: '#22c55e',
|
||||
delivered: '#22c55e'
|
||||
|
||||
Reference in New Issue
Block a user