Merge pull request #891 from eyecreate/patch-1

add day of week to anton clock
master
Gordon Williams 2021-11-22 09:10:11 +00:00 committed by GitHub
commit a8825373ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -4040,7 +4040,7 @@
{ {
"id": "antonclk", "id": "antonclk",
"name": "Anton Clock", "name": "Anton Clock",
"version": "0.02", "version": "0.03",
"description": "A simple clock using the bold Anton font.", "description": "A simple clock using the bold Anton font.",
"icon": "app.png", "icon": "app.png",
"screenshots": [{"url":"screenshot.png"}], "screenshots": [{"url":"screenshot.png"}],

View File

@ -1,2 +1,3 @@
0.01: New App! 0.01: New App!
0.02: Load widgets after setUI so widclk knows when to hide 0.02: Load widgets after setUI so widclk knows when to hide
0.03: Clock now shows day of week under date.

View File

@ -23,6 +23,7 @@ function draw() {
var date = new Date(); var date = new Date();
var timeStr = require("locale").time(date,1); var timeStr = require("locale").time(date,1);
var dateStr = require("locale").date(date).toUpperCase(); var dateStr = require("locale").date(date).toUpperCase();
var dowStr = require("locale").dow(date).toUpperCase();
// draw time // draw time
g.setFontAlign(0,0).setFont("Anton"); g.setFontAlign(0,0).setFont("Anton");
g.clearRect(0,y-40,g.getWidth(),y+35); // clear the background g.clearRect(0,y-40,g.getWidth(),y+35); // clear the background
@ -32,6 +33,10 @@ function draw() {
g.setFontAlign(0,0).setFont("6x8",2); g.setFontAlign(0,0).setFont("6x8",2);
g.clearRect(0,y-8,g.getWidth(),y+8); // clear the background g.clearRect(0,y-8,g.getWidth(),y+8); // clear the background
g.drawString(dateStr,x,y); g.drawString(dateStr,x,y);
//draw day of week
y += 16;
g.clearRect(0,y-8,g.getWidth(),y+8); // clear the background
g.drawString(dowStr,x,y);
// queue draw in one minute // queue draw in one minute
queueDraw(); queueDraw();
} }