✅ Cambios Implementados:
1. PostgreSQL (Base de Datos) Variables de entorno: TZ=Atlantic/Canary y PGTZ=Atlantic/Canary Configurado en todos los archivos Docker: docker-compose.yml, docker-compose.prod.yml, docker-stack.yml 2. Backend (FastAPI/Python) Configuración de zona horaria al inicio de main.py Conexión a PostgreSQL con parámetro de timezone Event listener que establece timezone en cada conexión a la BD Variable de entorno: TZ=Atlantic/Canary 3. Frontend (React) Ya estaba usando fechas locales correctamente con el constructor new Date(year, month, day) 4. Migración SQL Creado set_timezone_canary.sql para actualizar la BD existente
This commit is contained in:
@@ -4181,13 +4181,15 @@ function InspectionsTab({ inspections, user, onUpdate, onContinue }) {
|
||||
if (dateFrom || dateTo) {
|
||||
const inspectionDate = new Date(inspection.started_at)
|
||||
if (dateFrom) {
|
||||
const fromDate = new Date(dateFrom)
|
||||
fromDate.setHours(0, 0, 0, 0)
|
||||
// Crear fecha en hora local del usuario
|
||||
const [year, month, day] = dateFrom.split('-')
|
||||
const fromDate = new Date(year, month - 1, day, 0, 0, 0, 0)
|
||||
matchesDate = matchesDate && inspectionDate >= fromDate
|
||||
}
|
||||
if (dateTo) {
|
||||
const toDate = new Date(dateTo)
|
||||
toDate.setHours(23, 59, 59, 999)
|
||||
// Crear fecha en hora local del usuario
|
||||
const [year, month, day] = dateTo.split('-')
|
||||
const toDate = new Date(year, month - 1, day, 23, 59, 59, 999)
|
||||
matchesDate = matchesDate && inspectionDate <= toDate
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user