From 79acfbb5a8ac28dd204e2c594e575550609ea085 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Fri, 9 Dec 2022 13:14:02 +0000 Subject: [PATCH] Calendar clockinfo --- apps/clkinfocal/ChangeLog | 1 + apps/clkinfocal/app.png | Bin 0 -> 901 bytes apps/clkinfocal/clkinfo.js | 32 ++++++++++++++++++++++++++++++++ apps/clkinfocal/metadata.json | 12 ++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 apps/clkinfocal/ChangeLog create mode 100644 apps/clkinfocal/app.png create mode 100644 apps/clkinfocal/clkinfo.js create mode 100644 apps/clkinfocal/metadata.json diff --git a/apps/clkinfocal/ChangeLog b/apps/clkinfocal/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/clkinfocal/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/clkinfocal/app.png b/apps/clkinfocal/app.png new file mode 100644 index 0000000000000000000000000000000000000000..ed79cd884b54dc076665137caedbdcc1e21962c1 GIT binary patch literal 901 zcmV;01A6?4P)L)Chr)I}5{4KBxs*>drsWb|(+{ z`eX*c3AG?od-GwSG@uo!W#G_b8fZ7vCVtp4)v7#dGKtr!$EgN4;2#VXL(hv2dd3TGN!8sa)BjmJbkP|)vUz6BO_(u zuyPpl4)1BtyXRm4q^{jW-sguU5`^>393t;uBF-_2^}Bj5^AX`f0)Ezw8{8#@)`Ow9 z(TtP@0Hmc%g(j&403h#^|NrEB`{k1-;;QR+b+{n!3l-w3x_$$sayYCU0J)aSb;&8$ ztR)hZ=de5%d5`M)UF~Px0D%5ZUR75NN{X69Qu=y82z*0q_L1Va_wEDOPM^_pikkE~ z)q8+yAe!2!Ft8F`lb<414&%O&3O%%$LumdPnB)eEE-(BOx3GS!TXX%mZv=Dc1%!5L ze#&uKq08|(J@q$nx~hiDwQckq;2dH;I5OU4Q#vp { + 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; + } + } + ] + }; +}) diff --git a/apps/clkinfocal/metadata.json b/apps/clkinfocal/metadata.json new file mode 100644 index 000000000..6d6dd63fc --- /dev/null +++ b/apps/clkinfocal/metadata.json @@ -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"} + ] +}