diff --git a/src/components/EditStaff/EditStaff.tsx b/src/components/EditStaff/EditStaff.tsx index eb62306..9de9f01 100644 --- a/src/components/EditStaff/EditStaff.tsx +++ b/src/components/EditStaff/EditStaff.tsx @@ -161,10 +161,16 @@ const EditStaff: React.FC = ({ Staff, combos, SalaryEffectiveInfo }) })) } // remove useless data - if (postData.joinDate === 'Invalid Date') + if (postData.joinDate === 'Invalid Date') { postData.joinDate = null - if (postData.departDate === 'Invalid Date') + } else { + postData.joinDate = dayjs(postData.joinDate).format("YYYY-MM-DD") + } + if (postData.departDate === 'Invalid Date') { postData.departDate = null + } else { + postData.departDate = dayjs(postData.departDate).format("YYYY-MM-DD") + } if (!postData.joinPositionId) postData.joinPositionId = null