From a633a9f4baf0b761efef8a93a4c7dce44604b9a3 Mon Sep 17 00:00:00 2001 From: dormio <82835287+dormio@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:11:12 -0500 Subject: [PATCH 1/6] Update ChangeLog --- apps/clockcal/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/clockcal/ChangeLog b/apps/clockcal/ChangeLog index 6780313ce..f2365fab7 100644 --- a/apps/clockcal/ChangeLog +++ b/apps/clockcal/ChangeLog @@ -8,3 +8,4 @@ 0.08: Fixed typo in settings.js for DRAGDOWN to make option work 0.09: You can now back out of the calendar using the button 0.10: Fix linter warnings +0.11: Added option to show prior weeks on clock calendar From e46bdcb922131a77b00847fb5e26224d1cf53dc1 Mon Sep 17 00:00:00 2001 From: dormio <82835287+dormio@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:12:54 -0500 Subject: [PATCH 2/6] Update settings.js Added CAL_ROWS_PRIOR --- apps/clockcal/settings.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/clockcal/settings.js b/apps/clockcal/settings.js index ddacb4a16..7af0e797c 100644 --- a/apps/clockcal/settings.js +++ b/apps/clockcal/settings.js @@ -2,6 +2,7 @@ var FILE = "clockcal.json"; const defaults={ CAL_ROWS: 4, //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 @@ -39,6 +40,14 @@ writeSettings(); } }, + '#Cal Rows Prior': { + value: settings.CAL_ROWS_PRIOR, + min: 0, max: 4, + onchange: v => { + settings.CAL_ROWS_PRIOR = v; + writeSettings(); + } + }, 'Clock mode': { value: settings.MODE24, format: v => v ? "24h" : "12h", 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 3/6] 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++) { From a0c42670a19b7137faff3346c24ccba85d058f42 Mon Sep 17 00:00:00 2001 From: dormio <82835287+dormio@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:16:05 -0500 Subject: [PATCH 4/6] Update settings.js --- apps/clockcal/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/clockcal/settings.js b/apps/clockcal/settings.js index 7af0e797c..c3abe6f1c 100644 --- a/apps/clockcal/settings.js +++ b/apps/clockcal/settings.js @@ -1,7 +1,7 @@ (function (back) { var FILE = "clockcal.json"; const defaults={ - 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 From 751a4247cdd449198f961806b3a0e1bd775f3e85 Mon Sep 17 00:00:00 2001 From: dormio <82835287+dormio@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:18:15 -0500 Subject: [PATCH 5/6] Update app.js --- apps/clockcal/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/clockcal/app.js b/apps/clockcal/app.js index 8a510d28a..06436420a 100644 --- a/apps/clockcal/app.js +++ b/apps/clockcal/app.js @@ -188,7 +188,7 @@ function drawWatch() { bottomrightY = y * CELL_H + CAL_Y; g.setFont("Vector", 16); var fg = ((s.REDSUN && rD.getDay() == 0) || (s.REDSAT && rD.getDay() == 6)) ? '#f00' : '#fff'; - if (y == 1 && today == rDate) { + if (y == s.CAL_ROWS_PRIOR + 1 && today == rDate) { g.setColor('#0f0'); g.fillRect(bottomrightX - CELL_W + 1, bottomrightY - CELL_H - 1, bottomrightX, bottomrightY - 2); g.setColor('#000'); From 794e40f12d7f7906accb39819a69890dfcc2c76c Mon Sep 17 00:00:00 2001 From: dormio <82835287+dormio@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:50:28 -0500 Subject: [PATCH 6/6] Update metadata.json Changed version number --- apps/clockcal/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/clockcal/metadata.json b/apps/clockcal/metadata.json index b84b08575..189d68597 100644 --- a/apps/clockcal/metadata.json +++ b/apps/clockcal/metadata.json @@ -1,7 +1,7 @@ { "id": "clockcal", "name": "Clock & Calendar", - "version": "0.10", + "version": "0.11", "description": "Clock with Calendar", "readme":"README.md", "icon": "app.png",