Add: Formato DD-MM-YYYY para fechas de ingreso
This commit is contained in:
@@ -4,3 +4,13 @@ import { twMerge } from "tailwind-merge"
|
|||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formatDateDDMMYYYY(dateString: string): string {
|
||||||
|
if (!dateString) return '';
|
||||||
|
const date = new Date(dateString);
|
||||||
|
if (isNaN(date.getTime())) return dateString;
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const year = date.getFullYear();
|
||||||
|
return `${day}-${month}-${year}`;
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { formatDateDDMMYYYY } from '@/lib/utils';
|
||||||
import type { Vista, Internacion, Paciente, Cultivo } from '@/types';
|
import type { Vista, Internacion, Paciente, Cultivo } from '@/types';
|
||||||
|
|
||||||
interface DashboardProps {
|
interface DashboardProps {
|
||||||
@@ -209,7 +210,7 @@ export function Dashboard({
|
|||||||
{paciente ? `${paciente.apellido}, ${paciente.nombre}` : 'Paciente no encontrado'}
|
{paciente ? `${paciente.apellido}, ${paciente.nombre}` : 'Paciente no encontrado'}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-gray-500">
|
<p className="text-sm text-gray-500">
|
||||||
Ingreso: {internacion.fechaIngreso}
|
Ingreso: {formatDateDDMMYYYY(internacion.fechaIngreso)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Badge variant="outline" className="bg-purple-50 text-purple-700">
|
<Badge variant="outline" className="bg-purple-50 text-purple-700">
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
||||||
import type { Laboratorio, AcidoBase, Cultivo, Paciente, ResultadoLaboratorio, Internacion, Evolucion, Cama } from '@/types';
|
import type { Laboratorio, AcidoBase, Cultivo, Paciente, ResultadoLaboratorio, Internacion, Evolucion, Cama } from '@/types';
|
||||||
|
import { formatDateDDMMYYYY } from '@/lib/utils';
|
||||||
|
|
||||||
interface HistoriaClinicaProps {
|
interface HistoriaClinicaProps {
|
||||||
internacion: Internacion;
|
internacion: Internacion;
|
||||||
@@ -271,7 +272,7 @@ export function HistoriaClinica({
|
|||||||
<div className="grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm w-full">
|
<div className="grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm w-full">
|
||||||
<div>
|
<div>
|
||||||
<p className="text-gray-500">Fecha de Ingreso</p>
|
<p className="text-gray-500">Fecha de Ingreso</p>
|
||||||
<p className="font-medium">{internacion.fechaIngreso}</p>
|
<p className="font-medium">{formatDateDDMMYYYY(internacion.fechaIngreso)}</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-gray-500">Diagnóstico de Ingreso</p>
|
<p className="text-gray-500">Diagnóstico de Ingreso</p>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import type { Internacion, Paciente, Cama, Area, Evolucion, Laboratorio, Cultivo } from '@/types';
|
import type { Internacion, Paciente, Cama, Area, Evolucion, Laboratorio, Cultivo } from '@/types';
|
||||||
|
import { formatDateDDMMYYYY } from '@/lib/utils';
|
||||||
|
|
||||||
interface InternacionesProps {
|
interface InternacionesProps {
|
||||||
internaciones: Internacion[];
|
internaciones: Internacion[];
|
||||||
@@ -333,7 +334,7 @@ export function Internaciones({
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2 text-gray-600">
|
<div className="flex items-center gap-2 text-gray-600">
|
||||||
<Calendar className="h-4 w-4" />
|
<Calendar className="h-4 w-4" />
|
||||||
<span>Ingreso: {internacion.fechaIngreso}</span>
|
<span>Ingreso: {formatDateDDMMYYYY(internacion.fechaIngreso)}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2 text-gray-600">
|
<div className="flex items-center gap-2 text-gray-600">
|
||||||
<Stethoscope className="h-4 w-4" />
|
<Stethoscope className="h-4 w-4" />
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { Bed, CheckCircle2, Clock, Wrench, User, Plus, Trash, Edit2, Save, X } f
|
|||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { formatDateDDMMYYYY } from '@/lib/utils';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
@@ -331,7 +332,7 @@ export function MapaCamas({
|
|||||||
<p className="font-medium">Paciente:</p>
|
<p className="font-medium">Paciente:</p>
|
||||||
<p className="text-lg">{paciente.apellido}, {paciente.nombre}</p>
|
<p className="text-lg">{paciente.apellido}, {paciente.nombre}</p>
|
||||||
<p className="text-sm text-gray-500">DNI: {paciente.dni}</p>
|
<p className="text-sm text-gray-500">DNI: {paciente.dni}</p>
|
||||||
<p className="text-sm text-gray-500">Ingreso: {internacion.fechaIngreso}</p>
|
<p className="text-sm text-gray-500">Ingreso: {formatDateDDMMYYYY(internacion.fechaIngreso)}</p>
|
||||||
<p className="text-sm text-gray-500">Diagnóstico: {internacion.diagnosticoIngreso}</p>
|
<p className="text-sm text-gray-500">Diagnóstico: {internacion.diagnosticoIngreso}</p>
|
||||||
<p className="text-sm text-gray-500">Médico: {internacion.medicoIngresante}</p>
|
<p className="text-sm text-gray-500">Médico: {internacion.medicoIngresante}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user