diff --git a/.replit b/.replit index f835bea..c50bc15 100644 --- a/.replit +++ b/.replit @@ -19,10 +19,6 @@ externalPort = 80 localPort = 33035 externalPort = 3001 -[[ports]] -localPort = 37125 -externalPort = 4200 - [[ports]] localPort = 41343 externalPort = 3000 diff --git a/server/routes.ts b/server/routes.ts index 676ff97..1dac112 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -686,7 +686,13 @@ export async function registerRoutes(app: Express): Promise { return selectedDate >= contractStart && selectedDate <= contractEnd; }); - // Ottieni turni del giorno con assegnazioni (usando SQL date comparison) + // Ottieni turni del giorno con assegnazioni + const startOfDay = new Date(dateStr); + startOfDay.setHours(0, 0, 0, 0); + + const endOfDay = new Date(dateStr); + endOfDay.setHours(23, 59, 59, 999); + const dayShifts = await db .select({ shift: shifts, @@ -696,7 +702,8 @@ export async function registerRoutes(app: Express): Promise { .leftJoin(shiftAssignments, eq(shifts.id, shiftAssignments.shiftId)) .where( and( - sql`DATE(${shifts.startTime}) = ${dateStr}`, + gte(shifts.startTime, startOfDay), + lte(shifts.startTime, endOfDay), ne(shifts.status, "cancelled") ) )