Skip to content

Commit

Permalink
Merge pull request #3754 from JimMadge/dow
Browse files Browse the repository at this point in the history
terminalclock: Add day of week line
  • Loading branch information
bobrippling authored Feb 25, 2025
2 parents d028559 + 8c0a635 commit b2202cf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/terminalclock/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
0.09: Add default HRM value, default altitude value
0.10: Add fastloading
0.11: Add option for ISO 8601 date format
0.12: Add day of week line
8 changes: 7 additions & 1 deletion apps/terminalclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

["L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9"].forEach((line) => {
if (this[line] === "Date") drawDate(date, this.isoDate, curPos);
else if (this[line] === "DOW") drawDOW(date, curPos);
else if (this[line] === "HR") drawHRM(curPos);
else if (this[line] === "Motion") drawMotion(curPos);
else if (this[line] === "Alt") drawAltitude(curPos);
Expand Down Expand Up @@ -132,7 +133,8 @@
date = ">" + year + "-" + month + "-" + day;
} else {
let dow = locale.dow(now, 1);
date = locale.date(now, 1).substr(0, 6) + locale.date(now, 1).substr(-2);
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(-2); // short year e.g. 03 from 01/02/2003
date = ">" + dow + " " + date;
}
drawLine(date, pos);
Expand All @@ -142,6 +144,10 @@
drawLine(">", pos);
};

let drawDOW = function (now, pos) {
drawLine(">" + locale.dow(now, 0), pos);
};

let drawStepCount = function (pos) {
let health = Bangle.getHealthStatus("day");
let steps_formated = ">Steps: " + health.steps;
Expand Down
7 changes: 5 additions & 2 deletions apps/terminalclock/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"name": "Terminal Clock",
"shortName": "Terminal Clock",
"description": "A terminal CLI like clock displaying configurable, multiple sensor data",
"version": "0.11",
"version": "0.12",
"icon": "app.png",
"type": "clock",
"tags": "clock",
"supports": ["BANGLEJS", "BANGLEJS2"],
"supports": [
"BANGLEJS",
"BANGLEJS2"
],
"allow_emulator": false,
"readme": "README.md",
"storage": [
Expand Down
13 changes: 11 additions & 2 deletions apps/terminalclock/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,18 @@
}

if (process.env.HWVERSION == 2) {
var lineType = ["Date", "HR", "Motion", "Alt", "Steps", ">", "Empty"];
var lineType = [
"Date",
"DOW",
"HR",
"Motion",
"Alt",
"Steps",
">",
"Empty",
];
} else {
var lineType = ["Date", "HR", "Motion", "Steps", ">", "Empty"];
var lineType = ["Date", "DOW", "HR", "Motion", "Steps", ">", "Empty"];
}
function getLineChooser(lineID) {
return {
Expand Down

0 comments on commit b2202cf

Please sign in to comment.