From d4351c3b9dc4fb8890347150ca2d4720579ec521 Mon Sep 17 00:00:00 2001 From: dormio <82835287+dormio@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:15:46 -0500 Subject: [PATCH] Update app.js Added logic in drawWatch to account for CAL_ROWS_PRIOR --- apps/clockcal/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/clockcal/app.js b/apps/clockcal/app.js index 185f2adea..8a510d28a 100644 --- a/apps/clockcal/app.js +++ b/apps/clockcal/app.js @@ -2,7 +2,8 @@ Bangle.setUI("clock"); Bangle.loadWidgets(); var s = Object.assign({ - CAL_ROWS: 4, //number of calendar rows.(weeks) Shouldn't exceed 5 when using widgets. + CAL_ROWS: 4, //total number of calendar rows.(weeks) Shouldn't exceed 5 when using widgets. + CAL_ROWS_PRIOR: 0, //number of calendar rows.(weeks) that show above the current week BUZZ_ON_BT: true, //2x slow buzz on disconnect, 2x fast buzz on connect. Will be extra widget eventually MODE24: true, //24h mode vs 12h mode FIRSTDAY: 6, //First day of the week: mo, tu, we, th, fr, sa, su @@ -178,7 +179,7 @@ function drawWatch() { const dow = (s.FIRSTDAY + d.getDay()) % 7; //MO=0, SU=6 const today = d.getDate(); var rD = new Date(d.getTime()); - rD.setDate(rD.getDate() - dow); + rD.setDate(rD.getDate() - dow - s.CAL_ROWS_PRIOR * 7); var rDate = rD.getDate(); g.setFontAlign(1, 1); for (var y = 1; y <= s.CAL_ROWS; y++) {