Add leading zeros to day and month in iso date
parent
f7bd9b0528
commit
0b45079a10
|
|
@ -11,3 +11,4 @@
|
||||||
0.10: Add fastloading
|
0.10: Add fastloading
|
||||||
0.11: Add option for ISO 8601 date format
|
0.11: Add option for ISO 8601 date format
|
||||||
0.12: Add day of week line
|
0.12: Add day of week line
|
||||||
|
0.13: Fix ISO 8601 date, add leading zeros to day and month numbers, correct curPos for date function
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
curPos++;
|
curPos++;
|
||||||
|
|
||||||
["L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9"].forEach((line) => {
|
["L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9"].forEach((line) => {
|
||||||
if (this[line] === "Date") drawDate(date, this.isoDate, curPos);
|
if (this[line] === "Date") drawDate(date, curPos);
|
||||||
else if (this[line] === "DOW") drawDOW(date, curPos);
|
else if (this[line] === "DOW") drawDOW(date, curPos);
|
||||||
else if (this[line] === "HR") drawHRM(curPos);
|
else if (this[line] === "HR") drawHRM(curPos);
|
||||||
else if (this[line] === "Motion") drawMotion(curPos);
|
else if (this[line] === "Motion") drawMotion(curPos);
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
let year = now.getFullYear();
|
let year = now.getFullYear();
|
||||||
let month = now.getMonth() + 1; // Months are 0-11
|
let month = now.getMonth() + 1; // Months are 0-11
|
||||||
let day = now.getDate();
|
let day = now.getDate();
|
||||||
date = ">" + year + "-" + month + "-" + day;
|
date = ">" + year + "-" + String(month).padStart(2, "0") + "-" + String(day).padStart(2, "0");
|
||||||
} else {
|
} else {
|
||||||
let dow = locale.dow(now, 1);
|
let dow = locale.dow(now, 1);
|
||||||
date = locale.date(now, 1).substr(0, 6); // day and month e.g. 01/02/ from 01/02/2003
|
date = locale.date(now, 1).substr(0, 6); // day and month e.g. 01/02/ from 01/02/2003
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"name": "Terminal Clock",
|
"name": "Terminal Clock",
|
||||||
"shortName": "Terminal Clock",
|
"shortName": "Terminal Clock",
|
||||||
"description": "A terminal CLI like clock displaying configurable, multiple sensor data",
|
"description": "A terminal CLI like clock displaying configurable, multiple sensor data",
|
||||||
"version": "0.12",
|
"version": "0.13",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue