mirror of https://github.com/espruino/BangleApps
Merge pull request #2089 from eyecreate/master
Update macwatch2 app to use time based on locale settingspull/2093/head
commit
9965f372e7
|
@ -1,3 +1,4 @@
|
|||
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.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
|
||||
|
|
|
@ -30,15 +30,15 @@ function draw() {
|
|||
g.setFontAlign(0, -1, 0);
|
||||
g.setColor(0,0,0);
|
||||
var d = new Date();
|
||||
var da = d.toString().split(" ");
|
||||
hh = da[4].substr(0,2);
|
||||
mi = da[4].substr(3,2);
|
||||
var dt = require("locale").time(d, 1);
|
||||
var hh = dt.split(":")[0];
|
||||
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);
|
||||
mo = ("0"+((new Date()).getMonth()+1)).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.drawString(dd + ':' + mo + ':' + yy, 88, 120, true);
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "MacWatch2",
|
||||
"shortName":"MacWatch2",
|
||||
"icon": "app.png",
|
||||
"version":"0.03",
|
||||
"version":"0.04",
|
||||
"description": "Classic Mac Finder clock",
|
||||
"type": "clock",
|
||||
"tags": "clock",
|
||||
|
|
Loading…
Reference in New Issue