Merge pull request #1930 from deirdreobyrne/BigDClock-v0.03

Big Digit Clock - Internationalisation; small bug fix
pull/1934/head
Gordon Williams 2022-06-07 14:57:29 +01:00 committed by GitHub
commit 10ad18674f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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();

View File

@ -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",