Corregir desajuste de zona horaria usando fecha local getLocalToday en lugar de UTC ISO
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user