Corregir desajuste de zona horaria usando fecha local getLocalToday en lugar de UTC ISO
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { getNombreProfesional, isCamaFueraDeGrupo, computeSector, sortCamas } from '@/lib/utils';
|
||||
import { getNombreProfesional, isCamaFueraDeGrupo, computeSector, sortCamas, getLocalToday } from '@/lib/utils';
|
||||
import type {
|
||||
Paciente,
|
||||
Cama,
|
||||
@@ -255,7 +255,7 @@ export function useHospitalStore() {
|
||||
const nuevoPaciente: Paciente = {
|
||||
...paciente,
|
||||
id: generateUUID(),
|
||||
fechaRegistro: new Date().toISOString().split('T')[0],
|
||||
fechaRegistro: getLocalToday(),
|
||||
};
|
||||
try {
|
||||
await apiCall('POST', '/pacientes', nuevoPaciente);
|
||||
@@ -1343,7 +1343,7 @@ const actualizarInternacion = useCallback(async (internacionId: string, datos: P
|
||||
const nuevoPendiente: Pendiente = {
|
||||
...datos,
|
||||
id: generateUUID(),
|
||||
fechaCreacion: datos.fechaCreacion || new Date().toISOString().split('T')[0],
|
||||
fechaCreacion: datos.fechaCreacion || getLocalToday(),
|
||||
horaCreacion: datos.horaCreacion || new Date().toTimeString().slice(0, 5),
|
||||
estado: datos.estado || 'pendiente',
|
||||
prioridad: datos.prioridad || 'media',
|
||||
|
||||
Reference in New Issue
Block a user