From f91fc0559e53691b1194e2b79a13f5fe0911d6e3 Mon Sep 17 00:00:00 2001 From: NickJ-7010 Date: Wed, 21 Oct 2026 13:31:53 -0400 Subject: [PATCH 1/2] feat: Add timestamps to the counter reset log entries --- templates/counter.tmpl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/counter.tmpl b/templates/counter.tmpl index 94e57a5..9802293 100644 --- a/templates/counter.tmpl +++ b/templates/counter.tmpl @@ -11,6 +11,8 @@
reported by: +
+
@@ -98,6 +100,14 @@ return Math.floor((Date.now() - ts * 1000) / 86400000); } + function renderTimestamp(ts) { + const date = new Date(ts * 1000); + const weekdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; + const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + + return `${weekdays[date.getDay()]}, ${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()} at ${date.getHours() % 12 == 0 ? "12" : date.getHours() % 12}:${date.getMinutes().toString().padStart(2, "0")} ${date.getHours() < 12 ? "AM" : "PM"}`; + } + document.getElementById("deleteReset").addEventListener("show.bs.modal", function(event) { let button = event.relatedTarget document.getElementById("reset-modal-reset-id").value = button.getAttribute("data-reset-id") @@ -174,6 +184,7 @@ const li = template.content.firstElementChild.cloneNode(true); li.querySelector(".reset-desc").textContent = r.description; li.querySelector(".reset-user").textContent = r.username; + li.querySelector(".reset-timestamp").textContent = renderTimestamp(r.timestamp); li.querySelector(".days-since").textContent = daysSince(r.timestamp); if (r.can_delete) { @@ -247,4 +258,4 @@ -{{ end }} \ No newline at end of file +{{ end }} From 7fe99b2452e48b5681b2e976523048fc46bb1965 Mon Sep 17 00:00:00 2001 From: NickJ-7010 Date: Wed, 21 Oct 2026 14:21:38 -0400 Subject: [PATCH 2/2] fix: remove divider line when you cannot delete --- templates/counter.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/counter.tmpl b/templates/counter.tmpl index 9802293..c305df5 100644 --- a/templates/counter.tmpl +++ b/templates/counter.tmpl @@ -192,6 +192,10 @@ btn.dataset.resetId = r.id; btn.dataset.counterId = counterId; } else { + const div = li.querySelector(".border-bottom"); + div.classList.remove("border-bottom"); + div.classList.remove("mb-2"); + li.querySelector(".reset-actions").remove(); } return li;