From 610ee6b0fc268f28455fd2d6c90fc0dd3d96a63a Mon Sep 17 00:00:00 2001 From: Viviane Dias Date: Tue, 10 Sep 2024 15:59:47 -0300 Subject: [PATCH] fix: date formatter not transform in number before formatting to dash --- src/components/Question.tsx | 2 +- src/utils/formatDate.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Question.tsx b/src/components/Question.tsx index 674bc3f9..a5c0a0e7 100644 --- a/src/components/Question.tsx +++ b/src/components/Question.tsx @@ -6,7 +6,7 @@ export default function Question({ ...props }: Readonly<{ children: ReactNode; id?: string }>) { return ( - + {children} diff --git a/src/utils/formatDate.ts b/src/utils/formatDate.ts index 7218a3f5..012992c0 100644 --- a/src/utils/formatDate.ts +++ b/src/utils/formatDate.ts @@ -1,7 +1,7 @@ export default function formatDate(date: string): string { if (!date) return ""; - const [day, month, year] = date.split("/").map(Number); + const [day, month, year] = date.split("/"); return `${year}-${month}-${day}`; }