Corregir desajuste de zona horaria usando fecha local getLocalToday en lugar de UTC ISO

This commit is contained in:
2026-08-12 02:55:20 +00:00
parent e405ff7a82
commit d49250460b
8 changed files with 58 additions and 49 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { toast } from 'sonner';
import type { Pendiente, Internacion, Paciente, Cama } from '@/types';
import { formatDateDDMMYYYY, getNombreProfesional } from '@/lib/utils';
import { formatDateDDMMYYYY, getNombreProfesional, getLocalToday } from '@/lib/utils';
import { useHospitalStore } from '@/hooks/useHospitalStore';
interface PendientesSalaProps {
@@ -115,7 +115,7 @@ export function PendientesSala({
try {
await onActualizarPendiente(p.id, {
estado: nuevoEstado,
fechaRealizado: nuevoEstado === 'realizado' ? new Date().toISOString().split('T')[0] : undefined,
fechaRealizado: nuevoEstado === 'realizado' ? getLocalToday() : undefined,
usuarioRealizado: nuevoEstado === 'realizado' && currentUser ? getNombreProfesional(currentUser) : undefined,
});
toast.success(nuevoEstado === 'realizado' ? 'Marcado como realizado' : 'Marcado como pendiente');