diff --git a/src/components/ProfileType/ProfileTypeFormDateSelection.tsx b/src/components/ProfileType/ProfileTypeFormDateSelection.tsx index 356be9445de3d2cd836d80c15c976f4d812708e1..268a7f36327b748a7383c29c47f20054725bbbe2 100644 --- a/src/components/ProfileType/ProfileTypeFormDateSelection.tsx +++ b/src/components/ProfileType/ProfileTypeFormDateSelection.tsx @@ -25,8 +25,8 @@ interface ProfileTypeFormDateSelectionProps { } interface SelectionMonth { - label: string - value: number + label: string | null + value: string } const ProfileTypeFormDateSelection: React.FC<ProfileTypeFormDateSelectionProps> = ({ @@ -41,12 +41,14 @@ const ProfileTypeFormDateSelection: React.FC<ProfileTypeFormDateSelectionProps> const { t } = useI18n() const [selectedMonth, setSelectedMonth] = useState<any>({ label: DateTime.now().toLocaleString({ month: 'long' }), - value: DateTime.now().month, // Date.getMonth starts at 0 + value: DateTime.now() + .month.toString() + .padStart(2, '0'), // Date.getMonth starts at 0 }) const [selectedYear, setSelectedYear] = useState<number>(DateTime.now().year) const [answer, setAnswer] = useState<ProfileTypeAnswerChoices>('') - const selectMonths = [ + const selectMonths: SelectionMonth[] = [ { label: 'Janvier', value: '01',