@@ -39,10 +39,10 @@ const ModifyEducationModal: FC<ModifyEducationModalProps> = (props: ModifyEducat
3939 = useState < boolean > ( props . education ?. length === 0 || false )
4040
4141 const [ formValues , setFormValues ] : [
42- { [ key : string ] : string | boolean | Date | undefined } ,
43- Dispatch < SetStateAction < { [ key : string ] : string | boolean | Date | undefined } > >
42+ { [ key : string ] : string | boolean | Date | number | undefined } ,
43+ Dispatch < SetStateAction < { [ key : string ] : string | boolean | Date | number | undefined } > >
4444 ]
45- = useState < { [ key : string ] : string | boolean | Date | undefined } > ( { } )
45+ = useState < { [ key : string ] : string | boolean | Date | number | undefined } > ( { } )
4646
4747 const [ formErrors , setFormErrors ] : [
4848 { [ key : string ] : string } ,
@@ -91,9 +91,14 @@ const ModifyEducationModal: FC<ModifyEducationModalProps> = (props: ModifyEducat
9191 }
9292
9393 function handleFormValueChange ( key : string , event : React . ChangeEvent < HTMLInputElement > ) : void {
94+
95+ const value = key === 'endYear'
96+ ? Number ( event . target . value )
97+ : event . target . value
98+
9499 setFormValues ( {
95100 ...formValues ,
96- [ key ] : event . target . value ,
101+ [ key ] : value ,
97102 } )
98103 }
99104
@@ -266,11 +271,11 @@ const ModifyEducationModal: FC<ModifyEducationModalProps> = (props: ModifyEducat
266271 />
267272 < InputSelect
268273 options = { yearOptions }
269- value = { `${ getYear ( formValues . endDate as Date ) } ` }
270- onChange = { bind ( handleFormValueChange , this , 'endDate ' ) }
274+ value = { `${ Number ( formValues . endYear ) } ` }
275+ onChange = { bind ( handleFormValueChange , this , 'endYear ' ) }
271276 dirty
272- error = { formErrors . endDate }
273- name = 'endDate '
277+ error = { formErrors . endYear }
278+ name = 'endYear '
274279 label = 'End Year or Expected'
275280 placeholder = 'Select a year'
276281 tabIndex = { 0 }
0 commit comments