diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 1604c92..3b47988 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -19,13 +19,13 @@ export const formatDate = ( date: Date, format: 'short' | 'medium' | 'long' = 'medium' ): string => { - const options: Intl.DateTimeFormatOptions = { + const formatOptions: Record = { short: { day: '2-digit', month: '2-digit', year: 'numeric' }, medium: { day: '2-digit', month: 'short', year: 'numeric' }, long: { day: '2-digit', month: 'long', year: 'numeric' } - }[format]; + }; - return new Intl.DateTimeFormat('fr-FR', options).format(date); + return new Intl.DateTimeFormat('fr-FR', formatOptions[format]).format(date); }; /**