From 974bf7e03218fa40d3a31ff5b41d47807b22aafe Mon Sep 17 00:00:00 2001 From: Jubair70 Date: Mon, 31 Jul 2023 15:02:17 +0600 Subject: [PATCH] fix: Work Modal Datepicker --- client/modals/builder/sections/WorkModal.tsx | 26 ++++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/client/modals/builder/sections/WorkModal.tsx b/client/modals/builder/sections/WorkModal.tsx index 05c0504b..cc5c8781 100644 --- a/client/modals/builder/sections/WorkModal.tsx +++ b/client/modals/builder/sections/WorkModal.tsx @@ -151,14 +151,11 @@ const WorkModal: React.FC = () => { label={t('builder.common.form.start-date.label')} value={dayjs(field.value)} views={['year', 'month', 'day']} - slots={{ - textField: (params) => ( - - ), + 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')); @@ -177,14 +174,11 @@ const WorkModal: React.FC = () => { label={t('builder.common.form.end-date.label')} value={dayjs(field.value)} views={['year', 'month', 'day']} - slots={{ - textField: (params) => ( - - ), + 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'));