localize mclock date display

master
DerGuteWolf 2020-03-24 23:33:50 +01:00 committed by GitHub
parent c6db163e8f
commit f1eefaac89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
var locales = require("locale");
// Offscreen buffer
var buf = Graphics.createArrayBuffer(240,86,1,{msb:true});
function flip() {
@ -145,7 +146,7 @@ function draw(lastText,thisText,n) {
buf.drawString(("0"+d.getSeconds()).substr(-2), x, y-8);
// date
buf.setFontAlign(0,-1);
var date = d.toString().substr(0,15);
var date = locales?locales.date(d,false):d.toString().substr(0,15);
buf.drawString(date, buf.getWidth()/2, y+8);
flip();
}