Merge pull request #183 from DerGuteWolf/patch-1

Take into account discussion from #167
master
Gordon Williams 2020-04-02 10:03:30 +01:00 committed by GitHub
commit 658fe87724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -892,7 +892,7 @@
{ "id": "marioclock",
"name": "Mario Clock",
"icon": "marioclock.png",
"version":"0.03",
"version":"0.04",
"description": "Animated Mario clock, jumps to change the time!",
"tags": "clock,mario,retro",
"type": "clock",

View File

@ -1,3 +1,4 @@
0.01: Create mario app
0.02: Fix day of the week and add padding
0.03: use short date format from locale, take timeout from settings
0.04: modify date to display to be more at the original idea but still localized

View File

@ -285,7 +285,10 @@ function drawTime() {
function drawDate() {
g.setFont("6x8");
g.setColor(LIGHTEST);
const dateStr = locale.date(new Date(), true);
let d = new Date();
let dateStr = locale.date(d, true);
dateStr = dateStr.replace(d.getFullYear(), "").trim().replace(/\/$/i,"");
dateStr = locale.dow(d, true) + " " + dateStr;
g.drawString(dateStr, (W - g.stringWidth(dateStr))/2, 0, true);
}