Demostración Interactiva

Panel de plazos y términos para abogados

Calcula vencimientos judiciales en días hábiles excluyendo sábados, domingos e inhábiles oficiales, con semáforo y recordatorios automáticos.

Quiero esta herramienta en mi sitio
← Todas las funciones
Aviso legal: Información general con fines informativos; no sustituye la asesoría ni el patrocinio legal de un abogado. Los despachos, nombres y cifras presentados son ficticios y corresponden a datos de ejemplo.
📅 Calendario Oficial de Cómputo Judicial en México: Excluye fines de semana e inhábiles de LFT y PJF

⚖️ Cómputo de Término Legal

ℹ️ Regla procesal: El día de notificación no computa; el término corre a partir del siguiente día hábil.
Resultado del Cómputo:
Vence el: --/--/----
Días hábiles restantes: -- días

🔒 Privacidad garantizada: no guardamos nada en esta página. Los cálculos y simulaciones se procesan localmente en tu navegador.

let ASUNTOS = []; let filtroActual = 'todos'; const STORAGE_KEY = 'mktdmx_abogados_plazos_v1'; const EJEMPLOS_INICIALES = [ { id: '1', expediente: 'Exp. 1420/2026', cliente: 'Roberto Morales S.', tipo: 'Amparo Indirecto (15 días)', diasHabiles: 15, fechaNotif: '2026-10-06', fuero: 'federal' }, { id: '2', expediente: 'Toca 308/2026', cliente: 'Inmobiliaria Delta', tipo: 'Apelación Mercantil (9 días)', diasHabiles: 9, fechaNotif: '2026-10-08', fuero: 'cdmx' }, { id: '3', expediente: 'Demanda Laboral 95/2026', cliente: 'Martín Escobedo', tipo: 'Despido Injustificado (40 días)', diasHabiles: 40, fechaNotif: '2026-09-15', fuero: 'queretaro' }, { id: '4', expediente: 'Civil 652/2026', cliente: 'Dra. Gabriela Vega', tipo: 'Contestación de Demanda (9 días)', diasHabiles: 9, fechaNotif: '2026-10-12', fuero: 'edomex' }, { id: '5', expediente: 'Juicio Ejecutivo 112/2026', cliente: 'Financiera Bajío', tipo: 'Excepciones y Defensas (3 días)', diasHabiles: 3, fechaNotif: '2026-10-13', fuero: 'federal' } ]; function initPlazos() { // Poner fecha de hoy por defecto en el selector const hoyStr = new Date().toISOString().split('T')[0]; document.getElementById('pz-fecha-notif').value = hoyStr; try { const raw = localStorage.getItem(STORAGE_KEY); if (raw) { ASUNTOS = JSON.parse(raw); } else { ASUNTOS = [...EJEMPLOS_INICIALES]; } } catch(e) { ASUNTOS = [...EJEMPLOS_INICIALES]; } actualizarDiasTipo(); calcularVencimientoEnVivo(); renderizarAsuntos(); renderizarCalendario(); } function actualizarDiasTipo() { const val = document.getElementById('pz-tipo').value; const inp = document.getElementById('pz-dias'); if (val === 'amparo_15' || val === 'contestacion_15') inp.value = 15; else if (val === 'contestacion_9' || val === 'apelacion_9') inp.value = 9; else if (val === 'despido_lab') inp.value = 40; else if (val === 'revocacion_3') inp.value = 3; calcularVencimientoEnVivo(); } function calcularVencimientoEnVivo() { const fNotif = document.getElementById('pz-fecha-notif').value; const dias = parseInt(document.getElementById('pz-dias').value, 10) || 1; const fuero = document.getElementById('pz-fuero').value; if (!fNotif) return; const res = calcularVencimientoDiasHabiles(fNotif, dias, fuero); document.getElementById('pz-res-fecha').textContent = res.fechaVencimientoStr; const badge = document.getElementById('pz-res-badge'); const rest = res.diasHabilesRestantes; badge.textContent = `${rest} hábiles restantes`; badge.className = 'urg-badge urg-' + (res.semaforo === 'rojo' ? 'alta' : (res.semaforo === 'amarillo' ? 'media' : 'baja')); } function guardarNuevoPlazo() { const expediente = document.getElementById('pz-expediente').value.trim(); const cliente = document.getElementById('pz-cliente').value.trim() || 'Sin cliente especificado'; const fNotif = document.getElementById('pz-fecha-notif').value; const dias = parseInt(document.getElementById('pz-dias').value, 10) || 15; const fuero = document.getElementById('pz-fuero').value; const tipoSel = document.getElementById('pz-tipo'); const tipo = tipoSel.options[tipoSel.selectedIndex].text; const nuevo = { id: Date.now().toString(), expediente, cliente, tipo, diasHabiles: dias, fechaNotif: fNotif, fuero }; ASUNTOS.unshift(nuevo); guardarStorage(); renderizarAsuntos(); renderizarCalendario(); document.getElementById('pz-expediente').value = ''; document.getElementById('pz-cliente').value = ''; alert('✅ Término agregado exitosamente al panel.'); } function guardarStorage() { try { localStorage.setItem(STORAGE_KEY, JSON.stringify(ASUNTOS)); } catch(e) { console.warn('LocalStorage no disponible'); } } function cargarCasosEjemploPlazos() { ASUNTOS = [...EJEMPLOS_INICIALES]; guardarStorage(); renderizarAsuntos(); renderizarCalendario(); } function borrarTodosLosPlazos() { if (confirm('¿Deseas eliminar todos los plazos del panel?')) { ASUNTOS = []; guardarStorage(); renderizarAsuntos(); renderizarCalendario(); } } function eliminarAsunto(id) { ASUNTOS = ASUNTOS.filter(a => a.id !== id); guardarStorage(); renderizarAsuntos(); renderizarCalendario(); } function cambiarVistaPlazos(vista) { document.getElementById('tab-btn-lista').classList.toggle('on', vista === 'lista'); document.getElementById('tab-btn-cal').classList.toggle('on', vista === 'calendario'); document.getElementById('vista-lista').style.display = (vista === 'lista') ? 'block' : 'none'; document.getElementById('vista-calendario').style.display = (vista === 'calendario') ? 'block' : 'none'; } function filtrarSemaforo(color) { filtroActual = color; renderizarAsuntos(); } function renderizarAsuntos() { const cont = document.getElementById('lista-asuntos-container'); const q = (document.getElementById('filtro-busqueda').value || '').toLowerCase(); let items = ASUNTOS.map(a => { const calc = calcularVencimientoDiasHabiles(a.fechaNotif, a.diasHabiles, a.fuero); return { ...a, calc }; }); if (q) { items = items.filter(i => i.expediente.toLowerCase().includes(q) || i.cliente.toLowerCase().includes(q) || i.tipo.toLowerCase().includes(q)); } if (filtroActual !== 'todos') { items = items.filter(i => i.calc.semaforo === filtroActual); } // Ordenar por urgencia (días hábiles restantes ascendente) items.sort((a,b) => a.calc.diasHabilesRestantes - b.calc.diasHabilesRestantes); if (items.length === 0) { cont.innerHTML = '
No hay plazos registrados para este criterio de búsqueda.
'; return; } cont.innerHTML = items.map(item => { const c = item.calc; let cardClass = 'ok'; if (c.semaforo === 'rojo') cardClass = 'urgent'; else if (c.semaforo === 'amarillo') cardClass = 'warning'; else if (c.semaforo === 'gris') cardClass = 'expired'; const dotClass = 'sem-' + c.semaforo; return `
${item.expediente} ${item.cliente}
${c.diasHabilesRestantes} días hábiles
Vence: ${c.fechaVencimientoStr}
${item.tipo} • Notificado: ${item.fechaNotif} (${item.fuero.toUpperCase()})
${c.semaforo === 'rojo' ? '🚨 Término perentorio crítico' : (c.semaforo === 'amarillo' ? '⚠️ En término para revisión' : '🟢 Plazo holgado')}
`; }).join(''); } function renderizarCalendario() { const mesh = document.getElementById('calendario-mesh'); mesh.innerHTML = ''; const diasSem = ['Lun','Mar','Mié','Jue','Vie','Sáb','Dom']; diasSem.forEach(d => { const th = document.createElement('div'); th.className = 'cal-header'; th.textContent = d; mesh.appendChild(th); }); // Simulación mes de Octubre 2026 (1 de Octubre 2026 fue Jueves -> offset de 3 días) const offset = 3; const totalDias = 31; for (let i = 0; i < offset; i++) { const empty = document.createElement('div'); empty.style.opacity = '0.2'; mesh.appendChild(empty); } for (let dia = 1; dia <= totalDias; dia++) { const diaStr = dia < 10 ? '0' + dia : dia; const iso = `2026-10-${diaStr}`; const esFin = ((offset + dia - 1) % 7 === 5) || ((offset + dia - 1) % 7 === 6); const inhabil = esInhabil(iso, 'federal'); const cell = document.createElement('div'); cell.className = 'cal-day' + (esFin ? ' weekend' : '') + (inhabil ? ' inhabil' : ''); if (dia === 14) cell.classList.add('today'); let html = `${dia}`; if (inhabil) { html += `Inhábil`; } // Buscar vencimientos en este día ASUNTOS.forEach(a => { const calc = calcularVencimientoDiasHabiles(a.fechaNotif, a.diasHabiles, a.fuero); if (calc.fechaVencimientoStr.includes(`/${diaStr}/`)) { cell.classList.add('has-event'); html += `
${a.expediente}
`; } }); cell.innerHTML = html; mesh.appendChild(cell); } } function verRecordatorioSimulado(exp, cli, vence, rest) { const m = document.getElementById('modal-recordatorio'); const t = document.getElementById('recordatorio-texto'); m.style.display = 'block'; t.innerHTML = ` Plantilla WhatsApp / Notificación Automática:

"Estimado(a) ${cli}, le informamos desde el despacho que su asunto ${exp} tiene vencimiento procesal el día ${vence} (restan ${rest} días hábiles). El borrador de la promoción está listo para su firma y presentación en juzgado. Saludos cordiales." `; } window.addEventListener('DOMContentLoaded', () => { initPlazos(); });