mirror of https://github.com/espruino/BangleApps
Use localised month and day of the week from locale
parent
8aabcf28e8
commit
a6fab96de9
|
@ -511,7 +511,7 @@
|
||||||
{ "id": "dclock",
|
{ "id": "dclock",
|
||||||
"name": "Dev Clock",
|
"name": "Dev Clock",
|
||||||
"icon": "clock-dev.png",
|
"icon": "clock-dev.png",
|
||||||
"version":"0.08",
|
"version":"0.09",
|
||||||
"description": "A Digital Clock including timestamp (tst), beats(@), days in current month (dm) and days since new moon (l)",
|
"description": "A Digital Clock including timestamp (tst), beats(@), days in current month (dm) and days since new moon (l)",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
|
|
|
@ -5,4 +5,5 @@
|
||||||
0.05: add beats (@)
|
0.05: add beats (@)
|
||||||
0.06: tidy up
|
0.06: tidy up
|
||||||
0.07: add days in current month (md) and days since new moon (l)
|
0.07: add days in current month (md) and days since new moon (l)
|
||||||
0.08: update icon
|
0.08: update icon
|
||||||
|
0.09: Use localised month and day of the week from locale
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
var locale = require("locale");
|
||||||
/* jshint esversion: 6 */
|
/* jshint esversion: 6 */
|
||||||
const timeFontSize = 4;
|
const timeFontSize = 4;
|
||||||
const dateFontSize = 3;
|
const dateFontSize = 3;
|
||||||
|
@ -83,7 +84,7 @@ function drawSimpleClock() {
|
||||||
// draw Month name, Day of the week and beats
|
// draw Month name, Day of the week and beats
|
||||||
var beats = Math.floor((((dutc[0] + 1) % 24) + dutc[1] / 60 + dutc[2] / 3600) * 1000 / 24);
|
var beats = Math.floor((((dutc[0] + 1) % 24) + dutc[1] / 60 + dutc[2] / 3600) * 1000 / 24);
|
||||||
g.setFont(font, smallFontSize);
|
g.setFont(font, smallFontSize);
|
||||||
g.drawString(`m:${da[1]} d:${da[0]} @${beats}`, xyCenter, yposDayMonth, true);
|
g.drawString(`m:${locale.month(d,true)} d:${locale.dow(d,true)} @${beats}`, xyCenter, yposDayMonth, true);
|
||||||
|
|
||||||
// draw gmt
|
// draw gmt
|
||||||
var gmt = da[5];
|
var gmt = da[5];
|
||||||
|
|
Loading…
Reference in New Issue