Use localised month and day of the week from locale

pull/154/head
Oliver Sanders 2020-03-28 22:13:51 +00:00
parent 8aabcf28e8
commit a6fab96de9
3 changed files with 5 additions and 3 deletions

View File

@ -511,7 +511,7 @@
{ "id": "dclock",
"name": "Dev Clock",
"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)",
"tags": "clock",
"type":"clock",

View File

@ -5,4 +5,5 @@
0.05: add beats (@)
0.06: tidy up
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

View File

@ -1,3 +1,4 @@
var locale = require("locale");
/* jshint esversion: 6 */
const timeFontSize = 4;
const dateFontSize = 3;
@ -83,7 +84,7 @@ function drawSimpleClock() {
// 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);
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
var gmt = da[5];