Adjusted context to hopefully reflect accurate timezones relative to browser.
All checks were successful
Deploy Frontend / deploy (push) Successful in 40s

This commit is contained in:
Bailey Taylor
2025-10-08 08:03:54 +08:00
parent ac2c3ce6a9
commit 67334a65d8
5 changed files with 52 additions and 8 deletions

View File

@@ -7,6 +7,13 @@ import { DetailedDevice } from '@/types/devices';
import { disableConsoleInProd } from '@/lib/disableConsole';
disableConsoleInProd();
// Helper function to convert UTC timestamps to local time
const convertUtcToLocal = (utcString: string | null): string | null => {
if (!utcString) return null;
// Add 'Z' to indicate it's UTC, then convert to local time
return new Date(utcString + 'Z').toLocaleString();
};
interface DriveInfo {
@@ -125,7 +132,7 @@ export const DeviceProvider = ({
console.log('✅ Software fetched:', softwareRes.data);
console.groupEnd();
// STEP 1: Set basic data
// STEP 1: Set basic data (keep original UTC timestamps for calculations)
setDevices(devicesRes.data.devices);
setDeviceVulns(devicesRes.data.vulnerabilitiesByDevice);
setCachedSoftware(softwareRes.data);