Highlight weekends
This commit is contained in:
parent
6bdf83a971
commit
1d5afd5efe
1 changed files with 8 additions and 1 deletions
|
@ -128,7 +128,14 @@
|
|||
tr.id = rowId;
|
||||
// Date cell
|
||||
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.innerText = label;
|
||||
tr.appendChild(dateCell);
|
||||
|
|
Loading…
Reference in a new issue