From 85c3bec87b6fff02335baf45b2633e2fd9211506 Mon Sep 17 00:00:00 2001 From: Mikel Olasagasti Uranga Date: Jan 13 2026 16:37:52 +0000 Subject: Add date-based row highlighting to schedule HTML - Add schedule-highlight.js to highlight current/upcoming tasks - Orange highlight for tasks where today falls within date range - Green highlight for next upcoming task (when no current tasks) - Add CSS classes current-today and current-next to fedora-schedule.css Signed-off-by: Mikel Olasagasti Uranga --- diff --git a/html/fedora-schedule.css b/html/fedora-schedule.css index 8ca4040..3603124 100644 --- a/html/fedora-schedule.css +++ b/html/fedora-schedule.css @@ -86,3 +86,14 @@ td div a { .banner { text-align: center; } + +/* Highlight for current date row */ +table.schedule tr.current-today td { + background-color: var(--featuresOrange) !important; + font-weight: bold; +} + +/* Highlight for next upcoming milestone */ +table.schedule tr.current-next td { + background-color: var(--firstGreen) !important; +} diff --git a/html/schedule-highlight.js b/html/schedule-highlight.js new file mode 100644 index 0000000..e7dfb61 --- /dev/null +++ b/html/schedule-highlight.js @@ -0,0 +1,43 @@ +// Highlight current schedule row based on today's date +document.addEventListener('DOMContentLoaded', function() { + var today = new Date(); + today.setHours(0, 0, 0, 0); + var rows = document.querySelectorAll('table.schedule tr'); + var closestRow = null; + var closestDiff = Infinity; + var foundCurrent = false; + + rows.forEach(function(row) { + var dateCells = row.querySelectorAll('td.date'); + if (dateCells.length >= 2) { + // Extract date from format like 'Tue 2026-01-13' + var startText = dateCells[0].textContent.trim().split(' ').pop(); + var endText = dateCells[1].textContent.trim().split(' ').pop(); + var startDate = new Date(startText); + var endDate = new Date(endText); + + if (!isNaN(startDate) && !isNaN(endDate)) { + startDate.setHours(0, 0, 0, 0); + endDate.setHours(23, 59, 59, 999); + + // Highlight if today falls within the date range + if (today >= startDate && today <= endDate) { + row.classList.add('current-today'); + foundCurrent = true; + } + + // Track closest upcoming task (by start date) + var diff = startDate - today; + if (diff > 0 && diff < closestDiff) { + closestDiff = diff; + closestRow = row; + } + } + } + }); + + // If no current task, highlight the next upcoming row + if (!foundCurrent && closestRow) { + closestRow.classList.add('current-next'); + } +}); diff --git a/pgm-build-fedora b/pgm-build-fedora index ba9d2fa..4ff899d 100755 --- a/pgm-build-fedora +++ b/pgm-build-fedora @@ -171,11 +171,12 @@ for key in "${!reports[@]}"; do " - # We have to use a br here because schedule-convert gets angry if we have multiple paragraph - # elements in the footer. - HTML_FOOTER=" + # Wrap footer in div since schedule-convert needs a single root element + # JavaScript is in external file to avoid XML entity encoding issues + HTML_FOOTER="

Get this schedule as [.ics] [.json]
report an issue with this schedule

-" + +
" $BUILD_CMD $SCHEDULE_SRC f-$FEDORA_VERSION-$key-tasks.html --flat --sort date_start --html-table-header="$HTML_HEADER" ${reports_param[$key]} --html-table-footer="$HTML_FOOTER" --html-title="Fedora Linux $FEDORA_VERSION Schedule: ${reports[$key]}" --html-css-href="/groups/schedule/fedora-schedule.css" --html-level-indent 1 $BUILD_CMD $SCHEDULE_SRC f-$FEDORA_VERSION-$key.ics --target-format=ics ${reports_param[$key]}