mirror of https://github.com/espruino/BangleApps
2 lines
718 B
JavaScript
2 lines
718 B
JavaScript
(function(){return function(){function a(b){function a(c){var a=" ;one;two;three;four;five;six;seven;eight;nine".split(";"),b="ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split(" "),d=["twenty","thirty","forty","fifty"];return 10>c?{top:" ",bot:a[c]}:20>c?{top:" ",bot:b[c-10]}:60>c?{top:d[Math.floor(c/10)-2],bot:a[c%10]}:"error"}g.reset();g.clearRect(0,40,239,210);g.setColor(1,1,1);g.setFontAlign(0,0);g.setFont("Vector",32);var d=a(b.getHours());g.drawString(d.top,
|
|
120,60);g.drawString(d.bot,120,100);d=a(b.getMinutes());g.drawString(d.top,120,140);g.drawString(d.bot,120,180)}return{init:function(){a(new Date)},tick:function(){var b=new Date;0===b.getSeconds()&&a(b)}}}})(); |