diff --git a/.replit b/.replit index c50bc15..f835bea 100644 --- a/.replit +++ b/.replit @@ -19,6 +19,10 @@ externalPort = 80 localPort = 33035 externalPort = 3001 +[[ports]] +localPort = 37125 +externalPort = 4200 + [[ports]] localPort = 41343 externalPort = 3000 diff --git a/client/src/pages/sites.tsx b/client/src/pages/sites.tsx index a72f34d..b63d6ec 100644 --- a/client/src/pages/sites.tsx +++ b/client/src/pages/sites.tsx @@ -184,7 +184,7 @@ export default function Sites() { Aggiungi Sito - + Nuovo Sito @@ -422,7 +422,7 @@ export default function Sites() { {/* Edit Site Dialog */} !open && setEditingSite(null)}> - + Modifica Sito diff --git a/server/routes.ts b/server/routes.ts index 87e71f1..676ff97 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -659,10 +659,6 @@ export async function registerRoutes(app: Express): Promise { try { const dateStr = req.query.date as string || format(new Date(), "yyyy-MM-dd"); - // Imposta inizio e fine giornata in UTC - const startOfDay = new Date(dateStr + "T00:00:00.000Z"); - const endOfDay = new Date(dateStr + "T23:59:59.999Z"); - // Ottieni tutti i siti attivi const allSites = await db .select() @@ -690,7 +686,7 @@ export async function registerRoutes(app: Express): Promise { return selectedDate >= contractStart && selectedDate <= contractEnd; }); - // Ottieni turni del giorno con assegnazioni + // Ottieni turni del giorno con assegnazioni (usando SQL date comparison) const dayShifts = await db .select({ shift: shifts, @@ -700,8 +696,7 @@ export async function registerRoutes(app: Express): Promise { .leftJoin(shiftAssignments, eq(shifts.id, shiftAssignments.shiftId)) .where( and( - gte(shifts.startTime, startOfDay), - lte(shifts.startTime, endOfDay), + sql`DATE(${shifts.startTime}) = ${dateStr}`, ne(shifts.status, "cancelled") ) )