David Peer 2022-08-20 11:57:42 +02:00
commit fa6a1bc6eb
4 changed files with 9 additions and 7 deletions

View File

@ -83,6 +83,7 @@ function onInit(device) {
if (crc==3508163280 || crc==1418074094) version = "2v12"; if (crc==3508163280 || crc==1418074094) version = "2v12";
if (crc==4056371285) version = "2v13"; if (crc==4056371285) version = "2v13";
if (crc==1038322422) version = "2v14"; if (crc==1038322422) version = "2v14";
if (crc==2560806221) version = "2v15";
if (!ok) { if (!ok) {
version += `(⚠ update required)`; version += `(⚠ update required)`;
} }

View File

@ -1,3 +1,4 @@
0.01: Created first version of the app with numeric date, only works in light mode 0.01: Created first version of the app with numeric date, only works in light mode
0.02: New icon, shimmied date right a bit 0.02: New icon, shimmied date right a bit
0.03: Incorporated improvements from Peer David for accuracy, fix dark mode, widgets run in background 0.03: Incorporated improvements from Peer David for accuracy, fix dark mode, widgets run in background
0.04: Changed clock to use 12/24 hour format based on locale

View File

@ -30,15 +30,15 @@ function draw() {
g.setFontAlign(0, -1, 0); g.setFontAlign(0, -1, 0);
g.setColor(0,0,0); g.setColor(0,0,0);
var d = new Date(); var d = new Date();
var da = d.toString().split(" "); var dt = require("locale").time(d, 1);
hh = da[4].substr(0,2); var hh = dt.split(":")[0];
mi = da[4].substr(3,2); var mm = dt.split(":")[1];
g.drawString(hh, 52, 65, true);
g.drawString(mm, 132, 65, true);
g.drawString(':', 93,65);
dd = ("0"+(new Date()).getDate()).substr(-2); dd = ("0"+(new Date()).getDate()).substr(-2);
mo = ("0"+((new Date()).getMonth()+1)).substr(-2); mo = ("0"+((new Date()).getMonth()+1)).substr(-2);
yy = ("0"+((new Date()).getFullYear())).substr(-2); yy = ("0"+((new Date()).getFullYear())).substr(-2);
g.drawString(hh, 52, 65, true);
g.drawString(mi, 132, 65, true);
g.drawString(':', 93,65);
g.setFontCustom(font, 48, 8, 521); g.setFontCustom(font, 48, 8, 521);
g.drawString(dd + ':' + mo + ':' + yy, 88, 120, true); g.drawString(dd + ':' + mo + ':' + yy, 88, 120, true);

View File

@ -2,7 +2,7 @@
"name": "MacWatch2", "name": "MacWatch2",
"shortName":"MacWatch2", "shortName":"MacWatch2",
"icon": "app.png", "icon": "app.png",
"version":"0.03", "version":"0.04",
"description": "Classic Mac Finder clock", "description": "Classic Mac Finder clock",
"type": "clock", "type": "clock",
"tags": "clock", "tags": "clock",