diff --git a/src/app/[locale]/(main)/match/components/pdf/InfoTable.tsx b/src/app/[locale]/(main)/match/components/pdf/InfoTable.tsx index b8a6b6c..16f65d6 100644 --- a/src/app/[locale]/(main)/match/components/pdf/InfoTable.tsx +++ b/src/app/[locale]/(main)/match/components/pdf/InfoTable.tsx @@ -1,5 +1,7 @@ import { Text, View } from "@react-pdf/renderer"; +import { longDateLocaleString } from "@/utils/formatDate"; + import { styles } from "./styles"; interface IProps { @@ -20,7 +22,7 @@ const InfoTable = ({ date, lieu, ronde }: IProps) => ( {/* Data Row */} - {date ? new Date(date).toLocaleDateString("fr-FR") : " "} + {date ? longDateLocaleString({ date, locale: "fr-FR" }) : ""} {lieu || " "} {ronde || " "} diff --git a/src/utils/formatDate.ts b/src/utils/formatDate.ts index 4cef0b3..51ded22 100644 --- a/src/utils/formatDate.ts +++ b/src/utils/formatDate.ts @@ -8,3 +8,18 @@ const formatDate = (inputDate: any) => { }; export default formatDate; + +export const longDateLocaleString = ({ + date, + locale, +}: { + date: Date; + locale: string; +}) => { + return date.toLocaleDateString(locale, { + weekday: "long", + day: "numeric", + month: "long", + year: "numeric", + }); +};