Skip to content
Snippets Groups Projects
Commit 264830c4 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

fix(profileType): init correctly the date selection in profile type form

parent 8ec322e4
Branches
Tags
2 merge requests!536chore(release): 1.6.5,!532fix: init correctly the date selection in profile type form
......@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment