Shows day of month

pull/1897/head
Matrixes 2022-03-29 13:22:54 +02:00
parent 91cab3aee4
commit 6bded83f77
4 changed files with 7 additions and 6 deletions

View File

@ -2,3 +2,4 @@
0.02: Now tells time!
0.03: Interaction
0.04: Shows day of week
0.05: Shows day of month

View File

@ -10,7 +10,7 @@ The format of the bars are
* H: Hours
* m: Minutes
* Right section: MM9c
* M: Month
* M: Day of month
* w: Day of week
* c: Calculated EAN-8 digit checksum

View File

@ -1,4 +1,4 @@
var startOffsetX = 18;
var startOffsetX = 17;
var startOffsetHeight = 40;
var checkBarWidth = 10;
@ -29,9 +29,10 @@ function renderWatch(l) {
var d = new Date();
var h = d.getHours(), m = d.getMinutes();
var time = h + ":" + ("0"+m).substr(-2);
var month = ("0" + (d.getMonth()+1)).slice(-2);
//var month = ("0" + (d.getMonth()+1)).slice(-2);
var dayOfMonth = ('0' + d.getDate()).slice(-2);
var dayOfWeek = d.getDay() || 7;
var concatTime = ("0"+h).substr(-2) + ("0"+m).substr(-2) + month + dayOfWeek;
var concatTime = ("0"+h).substr(-2) + ("0"+m).substr(-2) + dayOfMonth + dayOfWeek;
const chars = String(concatTime).split("").map((concatTime) => {
return Number(concatTime);
@ -58,7 +59,6 @@ function renderWatch(l) {
clearTimeout(drawTimeout);
}
drawTimeout = setTimeout(function() {
drawTimeout = undefined;
layout.render(layout.watch);
}, 60000 - (Date.now() % 60000));

View File

@ -2,7 +2,7 @@
"name": "Barcode clock",
"shortName":"Barcode clock",
"icon": "barcode.icon.png",
"version":"0.04",
"version":"0.05",
"description": "EAN-8 compatible barcode clock.",
"tags": "barcode,ean,ean-8,watchface,clock,clockface",
"type": "clock",