From e5de06eba5694092e2446ca5d567301a1263aa2c Mon Sep 17 00:00:00 2001 From: deirdreobyrne Date: Tue, 7 Jun 2022 14:04:55 +0100 Subject: [PATCH] Internationalisation; small bug fix --- apps/bigdclock/ChangeLog | 1 + apps/bigdclock/bigdclock.app.js | 8 ++++++-- apps/bigdclock/metadata.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/bigdclock/ChangeLog b/apps/bigdclock/ChangeLog index ae5ae9224..2b6fcc7cb 100644 --- a/apps/bigdclock/ChangeLog +++ b/apps/bigdclock/ChangeLog @@ -1,2 +1,3 @@ 0.01: Initial version 0.02: setTimeout bug fix; no leading zero on date; lightmode; 12 hour format; cleanup +0.03: Internationalisation; bug fix - battery icon responds promptly to charging state diff --git a/apps/bigdclock/bigdclock.app.js b/apps/bigdclock/bigdclock.app.js index ce2368e87..7b26d4f17 100644 --- a/apps/bigdclock/bigdclock.app.js +++ b/apps/bigdclock/bigdclock.app.js @@ -29,6 +29,7 @@ function draw() { const level = E.getBattery(); const width = level + (level/2); var is12Hour = (require("Storage").readJSON("setting.json", 1) || {})["12hour"]; + var dows = require("date_utils").dows(0,1); g.reset(); g.clear(); @@ -46,7 +47,7 @@ function draw() { g.drawString(d, g.getWidth() -6, 98); g.setFont('Vector', 52); g.setFontAlign(-1, -1); - g.drawString("SUMOTUWETHFRSA".slice(2*w,2*w+2), 6, 103); + g.drawString(dows[w].slice(0,2).toUpperCase(), 6, 103); g.fillRect(9,159,166,171); g.fillRect(167,163,170,167); @@ -71,7 +72,6 @@ function draw() { queueDraw(); } -//the following section is also from waveclk Bangle.on('lcdPower', on => { if (on) { draw(); // draw immediately, queue redraw @@ -81,6 +81,10 @@ Bangle.on('lcdPower', on => { } }); +Bangle.on('charging', (charging) => { + draw(); +}); + Bangle.loadWidgets(); draw(); diff --git a/apps/bigdclock/metadata.json b/apps/bigdclock/metadata.json index c6be19138..e80dd9a04 100644 --- a/apps/bigdclock/metadata.json +++ b/apps/bigdclock/metadata.json @@ -1,7 +1,7 @@ { "id": "bigdclock", "name": "Big digit clock containing just the essentials", "shortName":"Big digit clk", - "version":"0.02", + "version":"0.03", "description": "A clock containing just the essentials, made as easy to read as possible for those of us that need glasses. It contains the time, the day-of-week, the day-of-month, and the current battery state-of-charge.", "icon": "bigdclock.png", "type": "clock",