From 276dc65195dcf23f62f38346b7b842012d44edd1 Mon Sep 17 00:00:00 2001 From: Deco Vander Date: Fri, 4 Jul 2025 11:12:09 -0400 Subject: [PATCH] Fix location expiry display to show correct 48-hour timeframe - Updated getTimeRemaining() function to use 48 hours instead of 24 hours - Updated getRemainingClass() function to calculate remaining time based on 48 hours - Frontend now matches backend 48-hour expiration policy - Time remaining display will now show up to ~47h instead of ~23h for new reports --- public/app-mapbox.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app-mapbox.js b/public/app-mapbox.js index 763794c..dcd4dce 100644 --- a/public/app-mapbox.js +++ b/public/app-mapbox.js @@ -165,7 +165,7 @@ document.addEventListener('DOMContentLoaded', async () => { tableLocationCount.textContent = `${locations.length} active report${locations.length !== 1 ? 's' : ''}`; }; - // Calculate time remaining until 24-hour expiration + // Calculate time remaining until 48-hour expiration const getTimeRemaining = (timestamp, persistent = false) => { if (persistent) { return 'Persistent'; @@ -173,7 +173,7 @@ document.addEventListener('DOMContentLoaded', async () => { const now = new Date(); const reportTime = new Date(timestamp); - const expirationTime = new Date(reportTime.getTime() + 24 * 60 * 60 * 1000); + const expirationTime = new Date(reportTime.getTime() + 48 * 60 * 60 * 1000); const remaining = expirationTime - now; if (remaining <= 0) return 'Expired'; @@ -196,7 +196,7 @@ document.addEventListener('DOMContentLoaded', async () => { const now = new Date(); const reportTime = new Date(timestamp); - const expirationTime = new Date(reportTime.getTime() + 24 * 60 * 60 * 1000); + const expirationTime = new Date(reportTime.getTime() + 48 * 60 * 60 * 1000); const remaining = expirationTime - now; const hoursRemaining = remaining / (1000 * 60 * 60);