Fix day of the week bug

master
Paul Cockrell 2020-03-26 20:45:16 +00:00
parent a78babc7b4
commit fa718d8746
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1,2 @@
0.01: Create mario app 0.01: Create mario app
0.02: Fix day of the week and add padding

View File

@ -282,13 +282,12 @@ function drawTime() {
function drawDate() { function drawDate() {
const date = new Date(); const date = new Date();
const day = locale.dow(date).substr(0, 3); const day = locale.dow(date).substr(0, 3);
const dayNum = date.getDay(); const dayNum = ("0" + date.getDate()).substr(-2);
const month = locale.month(date).substr(0, 3); const month = locale.month(date).substr(0, 3);
const year = date.getFullYear();
g.setFont("6x8"); g.setFont("6x8");
g.setColor(LIGHTEST); g.setColor(LIGHTEST);
g.drawString(`${day}, ${dayNum} ${month}`, 14, 0, true); g.drawString(`${day} ${dayNum} ${month}`, 10, 0, true);
} }
function redraw() { function redraw() {