Calendar clockinfo

pull/2381/head
Gordon Williams 2022-12-09 13:14:02 +00:00
parent d7fbe66163
commit 79acfbb5a8
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1 @@
0.01: New App!

BIN
apps/clkinfocal/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 B

View File

@ -0,0 +1,32 @@
(function() {
require("Font4x8Numeric").add(Graphics);
return {
name: "Bangle",
items: [
{ name : "Date",
get : () => {
let d = new Date();
let g = Graphics.createArrayBuffer(24,24,1,{msb:true});
g.drawImage(atob("FhgBDADAMAMP/////////////////////8AADwAAPAAA8AADwAAPAAA8AADwAAPAAA8AADwAAPAAA8AADwAAP///////"),1,0);
g.setFont("6x15").setFontAlign(0,0).drawString(d.getDate(),11,17);
return {
text : require("locale").dow(d,1).toUpperCase(),
img : g.asImage("string")
};
},
show : function() {
this.interval = setTimeout(()=>{
this.emit("redraw");
this.interval = setInterval(()=>{
this.emit("redraw");
}, 86400000);
}, 86400000 - (Date.now() % 86400000));
},
hide : function() {
clearInterval(this.interval);
this.interval = undefined;
}
}
]
};
})

View File

@ -0,0 +1,12 @@
{ "id": "clkinfocal",
"name": "Calendar Clockinfo",
"version":"0.01",
"description": "For clocks that display 'clockinfo' (messages that can be cycled through using the clock_info module) this displays the day of the month in the icon, and the weekday",
"icon": "app.png",
"type": "clkinfo",
"tags": "clkinfo,calendar",
"supports" : ["BANGLEJS2"],
"storage": [
{"name":"clkinfocal.clkinfo.js","url":"clkinfo.js"}
]
}