Skip to content

Commit 42f22ef

Browse files
committed
boxclk: fix watch day suffix
1 parent df55a8b commit 42f22ef

3 files changed

Lines changed: 3 additions & 7 deletions

File tree

apps/boxclk/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
- [+] Keep on-watch drag editing with double-tap save
2323
- [+] Remove global Graphics monkeypatching to fix newer-firmware startup
2424
0.13: Add `clkinfo` boxes
25+
0.14: Fix date day suffix display

apps/boxclk/app.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,6 @@
347347
return g.theme.fg;
348348
};
349349

350-
const usesEnglishOrdinals = (() => {
351-
const name = ((locale.name || "system") + "").toLowerCase();
352-
return name === "system" || /^en(?:[_ -]|$)/.test(name);
353-
})();
354-
355350
const formatItemValue = (item, date) => {
356351
let value = "";
357352
if (item.type === "time") {
@@ -371,7 +366,7 @@
371366
} else if (item.type === "date") {
372367
const month = locale.month(date, item.options.longMonth ? 0 : 1);
373368
const day = date.getDate();
374-
const dayString = String(day) + (item.options.suffix && usesEnglishOrdinals ? (day > 10 && day < 14 ? "th" : day % 10 === 1 ? "st" : day % 10 === 2 ? "nd" : day % 10 === 3 ? "rd" : "th") : "");
369+
const dayString = String(day) + (item.options.suffix ? (day > 10 && day < 14 ? "th" : day % 10 === 1 ? "st" : day % 10 === 2 ? "nd" : day % 10 === 3 ? "rd" : "th") : "");
375370
value = month + " " + dayString + (item.options.showYear ? ", " + date.getFullYear() : "");
376371
} else if (item.type === "day") {
377372
value = locale.dow(date, item.options.short ? 1 : 0);

apps/boxclk/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "boxclk",
33
"name": "Box Clock",
4-
"version": "0.13",
4+
"version": "0.14",
55
"author": "stweedo",
66
"description": "A customizable clock with multiple layouts, clkinfo and clockbg support, and a web editor",
77
"icon": "app.png",

0 commit comments

Comments
 (0)