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} }