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:
parent
e32dfd849f
commit
276dc65195
1 changed files with 3 additions and 3 deletions
|
@ -165,7 +165,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
tableLocationCount.textContent = `${locations.length} active report${locations.length !== 1 ? 's' : ''}`;
|
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) => {
|
const getTimeRemaining = (timestamp, persistent = false) => {
|
||||||
if (persistent) {
|
if (persistent) {
|
||||||
return 'Persistent';
|
return 'Persistent';
|
||||||
|
@ -173,7 +173,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const reportTime = new Date(timestamp);
|
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 remaining = expirationTime - now;
|
||||||
|
|
||||||
if (remaining <= 0) return 'Expired';
|
if (remaining <= 0) return 'Expired';
|
||||||
|
@ -196,7 +196,7 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const reportTime = new Date(timestamp);
|
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 remaining = expirationTime - now;
|
||||||
const hoursRemaining = remaining / (1000 * 60 * 60);
|
const hoursRemaining = remaining / (1000 * 60 * 60);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue