Highlight weekends

This commit is contained in:
Adam Štrauch 2025-09-15 14:08:09 +02:00
parent 6bdf83a971
commit 1d5afd5efe
Signed by: cx
GPG key ID: 7262DAFE292BCE20

View file

@ -128,7 +128,14 @@
tr.id = rowId; tr.id = rowId;
// Date cell // Date cell
const dateCell = document.createElement('td'); const dateCell = document.createElement('td');
dateCell.className = 'px-1 bg-neutral-200 w-16'; let dateCellClass = 'px-1 w-16 ';
// Weekend: Saturday (6) or Sunday (0)
if (date.getDay() === 0 || date.getDay() === 6) {
dateCellClass += 'bg-neutral-500';
} else {
dateCellClass += 'bg-neutral-200';
}
dateCell.className = dateCellClass;
dateCell.id = `date-${dateString}`; dateCell.id = `date-${dateString}`;
dateCell.innerText = label; dateCell.innerText = label;
tr.appendChild(dateCell); tr.appendChild(dateCell);