From 48da0cbacfff51febdc72c952bb21b45ca644764 Mon Sep 17 00:00:00 2001 From: Craig Millett Date: Tue, 21 Dec 2021 12:11:30 -0700 Subject: [PATCH] Update calendar.js If week is set to start on Sunday, make Saturday (last row) and Sunday (first row) have weekend colors. --- apps/calendar/calendar.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/calendar/calendar.js b/apps/calendar/calendar.js index 01977570a..00e7d54cc 100644 --- a/apps/calendar/calendar.js +++ b/apps/calendar/calendar.js @@ -110,10 +110,19 @@ function drawCalendar(date) { g.clearRect(0, 0, maxX, maxY); g.setBgColor(bgColorMonth); g.clearRect(0, 0, maxX, headerH); - g.setBgColor(bgColorDow); - g.clearRect(0, headerH, maxX, headerH + rowH); - g.setBgColor(bgColorWeekend); - g.clearRect(colW * 5, headerH + rowH, maxX, maxY); + if (settings.startOnSun){ + g.setBgColor(bgColorWeekend); + g.clearRect(0, headerH + rowH, colW, maxY); + g.setBgColor(bgColorDow); + g.clearRect(0, headerH, maxX, headerH + rowH); + g.setBgColor(bgColorWeekend); + g.clearRect(colW * 6, headerH + rowH, maxX, maxY); + } else { + g.setBgColor(bgColorDow); + g.clearRect(0, headerH, maxX, headerH + rowH); + g.setBgColor(bgColorWeekend); + g.clearRect(colW * 5, headerH + rowH, maxX, maxY); + } for (let y = headerH; y < maxY; y += rowH) { g.drawLine(0, y, maxX, y); }