Skip to content

Commit

Permalink
fix: date formatter not transform in number before formatting to dash
Browse files Browse the repository at this point in the history
  • Loading branch information
vivianedias committed Sep 10, 2024
1 parent 3e0c76d commit 610ee6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function Question({
...props
}: Readonly<{ children: ReactNode; id?: string }>) {
return (
<Box asChild pb={{ initial: "5", sm: "6" }}>
<Box asChild pb={{ initial: "5", sm: "6" }} width={"100%"}>
<Text asChild align={"center"} as={"p"} size={"3"} {...props}>
<legend>{children}</legend>
</Text>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/formatDate.ts
Original file line number Diff line number Diff line change
@@ -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}`;
}

0 comments on commit 610ee6b

Please sign in to comment.