From 5d38f197a827afe0c9b88282ab8b2c4dde30b776 Mon Sep 17 00:00:00 2001 From: "MSI\\derek" Date: Tue, 13 Aug 2024 17:50:57 +0800 Subject: [PATCH] update --- src/components/EditStaff/EditStaff.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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