This should fix it all

This commit is contained in:
Gabriel Brown 2024-07-20 21:48:18 -05:00
parent facdbde5f1
commit 51cdd26545

View File

@ -54,7 +54,7 @@ interface PaginatedHistory {
// Function to Convert Date to UTC // Function to Convert Date to UTC
const convertToUTC = (date: Date): Date => { const convertToUTC = (date: Date): Date => {
const utcDate = new Date(date.setHours(date.getUTCHours() - 15)); const utcDate = new Date(date.setHours(date.getUTCHours() - 12));
return utcDate; return utcDate;
} }
@ -126,8 +126,7 @@ export const legacyUpdateEmployeeStatusByName = async (technicians: { name: stri
// Prepare and execute the queries for each technician // Prepare and execute the queries for each technician
for (const technician of technicians) { for (const technician of technicians) {
const { name, status } = technician; const { name, status } = technician;
const date = new Date(); const utcdate: Date = convertToUTC(new Date());
const utcdate: Date = new Date(date.setHours(date.getUTCHours() - 12));
const query = sql` const query = sql`
UPDATE users UPDATE users
SET status = ${status}, updatedAt = ${utcdate} SET status = ${status}, updatedAt = ${utcdate}