Adjusted context to hopefully reflect accurate timezones relative to browser.
All checks were successful
Deploy Frontend / deploy (push) Successful in 40s
All checks were successful
Deploy Frontend / deploy (push) Successful in 40s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user