Deje de usar cdn y mejore el calendario

This commit is contained in:
2026-04-04 16:37:14 -03:00
parent 8102265f92
commit 8ac56c7960
6 changed files with 152 additions and 14 deletions
+20 -10
View File
@@ -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'