From 8ebf13e149411cf73f5c8f17f7925eab2f84b75e Mon Sep 17 00:00:00 2001 From: ldh8994 Date: Thu, 23 Jan 2025 14:30:51 +0900 Subject: [PATCH] =?UTF-8?q?[bugfix/#571]=20=EC=A0=84=EC=9B=94=20=ED=9A=8C?= =?UTF-8?q?=EA=B3=84=EB=82=B4=EC=97=AD=20=EC=B6=94=EA=B0=80=20=EC=95=88?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Components/Common/Modal/ModalUpdateBankHistory.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/Common/Modal/ModalUpdateBankHistory.tsx b/src/Components/Common/Modal/ModalUpdateBankHistory.tsx index 08b1773..e60e70a 100644 --- a/src/Components/Common/Modal/ModalUpdateBankHistory.tsx +++ b/src/Components/Common/Modal/ModalUpdateBankHistory.tsx @@ -104,7 +104,7 @@ const ModalUpdateBankHistory = () => { const today = new Date(); if (historyType === 'income') { if (infos.dateUsed === '') { alert('사용일을 입력해주세요'); return false} - if (new Date(infos.dateUsed).toDateString() >= today.toDateString()) { alert(`${today.getMonth()+1}월 ${today.getDate()}일 이전의 날짜를 입력해주세요`); return false} + if (new Date(infos.dateUsed).toISOString().slice(0, 10) > today.toISOString().slice(0, 10)) { alert(`${today.getMonth()+1}월 ${today.getDate()}일 이전의 날짜를 입력해주세요`); return false} if (infos.title === '') { alert('제목을 입력해주세요'); return false} if (infos.income !== String(parseInt(infos.income))) { alert('올바른 수입액을 입력해주세요'); return false} if (parseInt(infos.income) <= 0) { alert('1원 이상의 수입액을 입력해주세요'); return false} @@ -112,10 +112,10 @@ const ModalUpdateBankHistory = () => { if (historyType === 'outcome') { if (infos.dateUsed === '') { alert('사용일을 입력해주세요'); return false} - if (new Date(infos.dateUsed).toDateString() >= today.toDateString()) { alert(`${today.getMonth()+1}월 ${today.getDate()}일 이전의 날짜를 입력해주세요`); return false} + if (new Date(infos.dateUsed).toISOString().slice(0, 10) > today.toISOString().slice(0, 10)) { alert(`${today.getMonth()+1}월 ${today.getDate()}일 이전의 날짜를 입력해주세요`); return false} if (infos.title === '') { alert('제목을 입력해주세요'); return false} if (selectedInfos.name === '') { alert('회비 사용 부원을 입력해주세요'); return false} - if (infos.outcome !== String(parseInt(infos.outcome))) { alert('올바른 수입액을 입력해주세요'); return false} + if (infos.outcome !== String(parseInt(infos.outcome))) { alert('올바른 지출액을 입력해주세요'); return false} if (parseInt(infos.outcome) <= 0) { alert('1원 이상의 지출액을 입력해주세요'); return false} }