견적서 견적일 필드 지울때 에러 처리

This commit is contained in:
basssy 2024-12-09 14:27:39 +09:00
parent ffc770f2dc
commit 396d01f288

View File

@ -177,9 +177,14 @@ export default function Estimate({ params }) {
// set
useEffect(() => {
let estimateDate = dayjs(startDate).format('YYYY-MM-DD')
if (begin === 1) {
setEstimateContextState({ estimateDate: estimateDate })
let estimateDate
if (startDate) {
estimateDate = dayjs(startDate).format('YYYY-MM-DD')
if (begin === 1) {
setEstimateContextState({ estimateDate: estimateDate })
}
} else {
setEstimateContextState({ estimateDate: '' })
}
}, [startDate])