Fixes timestamps in cache

main
Yasen Pramatarov 2024-10-02 22:50:27 +03:00
parent 4e19a1c571
commit 4f0601cff7
1 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,8 @@ function fetchData(agent_id, url, endpoint, jwtToken, force = false) {
resultElement.innerHTML = JSON.stringify(result, null, 2);
// Show the cache timestamp from the session
const cacheTimestamp = new Date(result.cache_time);
const now = Date.now();
const cacheTimestamp = new Date(now);
// Display the cache retrieval date and time
const formattedDate = cacheTimestamp.toLocaleDateString();
@ -135,7 +136,7 @@ function loadCache(agent_id) {
resultElement.innerHTML = JSON.stringify(response.data, null, 2);
// Get the cache timestamp from the session
const cacheTimestamp = new Date(response.cache_time);
const cacheTimestamp = new Date(response.cache_time * 1000);
// Display the cache retrieval date and time
const formattedDate = cacheTimestamp.toLocaleDateString();