From 27364ca495b714aa1f24f41feb91a111b9daacc1 Mon Sep 17 00:00:00 2001 From: Sidney Date: Mon, 25 May 2026 14:27:58 -0300 Subject: [PATCH] fix(portal): handle iso strings correctly in formatDate for birthDate rendering --- portal/src/pages/MeusDados.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/portal/src/pages/MeusDados.tsx b/portal/src/pages/MeusDados.tsx index 7e83c8f..0bf697f 100644 --- a/portal/src/pages/MeusDados.tsx +++ b/portal/src/pages/MeusDados.tsx @@ -53,8 +53,11 @@ export default function MeusDados() { if (!student) return null; const formatDate = (d: string) => { - const date = new Date(d + 'T00:00:00'); - return date.toLocaleDateString('pt-BR'); + if (!d) return '—'; + // Se a data já for um timestamp ISO (ex: vindo do banco PostgreSQL), não adicionamos o 'T00:00:00' + const dateStr = d.includes('T') ? d : d + 'T00:00:00'; + const date = new Date(dateStr); + return isNaN(date.getTime()) ? '—' : date.toLocaleDateString('pt-BR', { timeZone: 'UTC' }); }; const InfoRow = ({ icon: Icon, label, value }: { icon: any; label: string; value?: string }) => (