Merge pull request #1403 from Jubair70/fix_education_modal_datepicker

fix: Education Date picker modal UI component
This commit is contained in:
Amruth Pillai
2023-07-25 14:50:46 +02:00
committed by GitHub

View File

@ -172,14 +172,11 @@ const EducationModal: React.FC = () => {
label={t('builder.common.form.start-date.label')}
value={dayjs(field.value)}
views={['year', 'month', 'day']}
slots={{
textField: (params) => (
<TextField
{...params}
error={!!fieldState.error}
helperText={fieldState.error?.message || params.inputProps?.placeholder}
/>
),
slotProps={{
textField: {
error: !!fieldState.error,
helperText: fieldState.error?.message || t('builder.common.form.start-date.help-text')
},
}}
onChange={(date: dayjs.Dayjs | null) => {
date && dayjs(date).isValid() && field.onChange(dayjs(date).format('YYYY-MM-DD'));
@ -198,14 +195,11 @@ const EducationModal: React.FC = () => {
label={t('builder.common.form.end-date.label')}
value={dayjs(field.value)}
views={['year', 'month', 'day']}
slots={{
textField: (params) => (
<TextField
{...params}
error={!!fieldState.error}
helperText={fieldState.error?.message || t('builder.common.form.end-date.help-text')}
/>
),
slotProps={{
textField: {
error: !!fieldState.error,
helperText: fieldState.error?.message || t('builder.common.form.end-date.help-text')
},
}}
onChange={(date: dayjs.Dayjs | null) => {
date && dayjs(date).isValid() && field.onChange(dayjs(date).format('YYYY-MM-DD'));