allow for a starting date and hidden hunt if it hasnt started
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 31s

This commit is contained in:
2026-03-19 14:39:06 -04:00
parent 79c0b883f7
commit 34b3a4cbd0
12 changed files with 107 additions and 30 deletions

View File

@@ -2,18 +2,23 @@
(function () {
function timeAgo(date) {
const now = new Date();
const seconds = Math.floor((now - date) / 1000);
if (seconds < 5) return 'just now';
if (seconds < 60) return seconds + 's ago';
const diff = now - date;
const seconds = Math.floor(Math.abs(diff) / 1000);
const isFuture = diff < 0;
const prefix = isFuture ? 'in ' : '';
const suffix = isFuture ? '' : ' ago';
if (seconds < 5) return isFuture ? 'in a moment' : 'just now';
if (seconds < 60) return prefix + seconds + 's' + suffix;
const minutes = Math.floor(seconds / 60);
if (minutes < 60) return minutes + 'm ago';
if (minutes < 60) return prefix + minutes + 'm' + suffix;
const hours = Math.floor(minutes / 60);
if (hours < 24) return hours + 'h ago';
if (hours < 24) return prefix + hours + 'h' + suffix;
const days = Math.floor(hours / 24);
if (days < 7) return days + 'd ago';
if (days < 30) return Math.floor(days / 7) + 'w ago';
if (days < 365) return Math.floor(days / 30) + 'mo ago';
return Math.floor(days / 365) + 'y ago';
if (days < 7) return prefix + days + 'd' + suffix;
if (days < 30) return prefix + Math.floor(days / 7) + 'w' + suffix;
if (days < 365) return prefix + Math.floor(days / 30) + 'mo' + suffix;
return prefix + Math.floor(days / 365) + 'y' + suffix;
}
function updateTimes() {