mas visible en calendario

This commit is contained in:
2026-08-11 23:46:30 -05:00
parent 73d83c8212
commit 5a0dca31cc
3 changed files with 86 additions and 11 deletions
+14 -10
View File
@@ -44,18 +44,21 @@ function renderCalendar() {
const dateStr = year + '-' + String(month + 1).padStart(2, '0') + '-' + String(d).padStart(2, '0');
const delDia = todosPendientes.filter(function(p) { return p.fecha === dateStr; });
const dayEl = document.createElement('div');
dayEl.className = 'day';
dayEl.innerHTML = '<span class="day-number">' + d + '</span>';
const tieneVencidos = delDia.some(function(p) { return esVencido(p); });
dayEl.className = 'day' + (tieneVencidos ? ' vencido-dia' : '');
let html = '<span class="day-number">' + d + '</span>';
if (delDia.length) {
const dots = document.createElement('div');
dots.className = 'day-dots';
delDia.slice(0, 4).forEach(function(p) {
const dot = document.createElement('span');
dot.className = 'dot ' + (esVencido(p) ? 'alta' : p.urgencia);
dots.appendChild(dot);
});
dayEl.appendChild(dots);
const vencidosCount = delDia.filter(function(p) { return esVencido(p); }).length;
const badgeClass = vencidosCount > 0 ? 'day-count vencidos' : 'day-count';
const badgeText = delDia.length > 9 ? '9+' : String(delDia.length);
html += '<span class="' + badgeClass + '">' + badgeText + '</span>';
const primero = delDia[0];
const texto = escaparHtml(primero.descripcion);
html += '<div class="day-summary">' + texto + '</div>';
}
dayEl.innerHTML = html;
dayEl.onclick = function() { abrirModalDia(dateStr, delDia); };
grid.appendChild(dayEl);
}
@@ -205,3 +208,4 @@ async function eliminarPendiente(id) {
}
cargarPendientes();