aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-11-26 00:00:00 +0000
committertdro <tdro@noreply.example.com>2024-11-26 00:00:00 +0000
commit6ce5b716ad023059c87ba378dd236e353f78a7cc (patch)
treebbbc726a77eaf17a387a30183c5905c6882c81f7
parent0f7b85cf557dd12316b563302accaf4905beedfb (diff)
downloadcanory-master.tar.gz
canory-master.tar.bz2
canory-master.zip
static/js/timeago: Cap past to 3 daysHEADmaster
-rw-r--r--assets/js/index.js2
-rw-r--r--static/js/timeago.ts8
2 files changed, 5 insertions, 5 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index 949aae5..01f30ef 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -960,7 +960,7 @@
if (hours <= 48) {
return element.textContent = tiny(relative.format(-1 * hours, "hour"), 1);
}
- if (days <= 7) {
+ if (days <= 3) {
return element.textContent = tiny(relative.format(-1 * days, "day"), 1);
}
}
diff --git a/static/js/timeago.ts b/static/js/timeago.ts
index 7c1973d..3e82d58 100644
--- a/static/js/timeago.ts
+++ b/static/js/timeago.ts
@@ -59,13 +59,13 @@
if (past) {
if (seconds <= 60) { return element.textContent = tiny(relative.format(-1 * seconds, "second",), 1); }
if (minutes <= 120) { return element.textContent = tiny(relative.format(-1 * minutes, "minute",), 1); }
- if (hours <= 48) { return element.textContent = tiny(relative.format(-1 * hours, "hour",), 1); }
- if (days <= 7) { return element.textContent = tiny(relative.format(-1 * days, "day",), 1); }
+ if (hours <= 48) { return element.textContent = tiny(relative.format(-1 * hours, "hour",), 1); }
+ if (days <= 3) { return element.textContent = tiny(relative.format(-1 * days, "day",), 1); }
}
if (future) {
- if (-1 * days >= 4) { return element.textContent = tiny(relative.format(-1 * days, "day",), 2); }
- if (-1 * hours >= 3) { return element.textContent = tiny(relative.format(-1 * hours, "hour",), 2); }
+ if (-1 * days >= 4) { return element.textContent = tiny(relative.format(-1 * days, "day",), 2); }
+ if (-1 * hours >= 3) { return element.textContent = tiny(relative.format(-1 * hours, "hour",), 2); }
if (-1 * minutes >= 2) { return element.textContent = tiny(relative.format(-1 * minutes, "minute",), 2); }
if (-1 * seconds >= 1) { return element.textContent = tiny(relative.format(-1 * seconds, "second",), 2); }
}