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
This commit is contained in:
Deco Vander 2025-07-04 11:12:09 -04:00
parent e32dfd849f
commit 276dc65195

View file

@ -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);