diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index 3ba06d0..b2794dc 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -3116,6 +3116,14 @@ function SeccionPendientes({ pacienteId, internacionId, canEdit }: { pacienteId: return; } + if (horaProgramada.trim()) { + const timeRegex = /^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/; + if (!timeRegex.test(horaProgramada.trim())) { + toast.error('La hora programada debe estar en formato de 24hs (ej: 14:30)'); + return; + } + } + try { const payload: Partial = { descripcion, @@ -3428,11 +3436,18 @@ function SeccionPendientes({ pacienteId, internacionId, canEdit }: { pacienteId: />
- + setHoraProgramada(e.target.value)} + onChange={e => { + let val = e.target.value; + val = val.replace(/[^0-9:]/g, ''); + if (val.length <= 5) { + setHoraProgramada(val); + } + }} className="mt-1 h-9 text-xs" />