Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Components/Common/Modal/ModalUpdateBankHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,18 @@ 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}
}

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

Expand Down