const disabledDateStart = useCallback((current) => {
if (!contractEndDateValue) {
return false
} else {
return current && current > contractEndDateValue;
}
}, [contractEndDateValue])
const disabledDateEnd = useCallback((current) => {
if (!contractSignDateValue) {
return false
} else {
return current && current < contractSignDateValue;
}
}, [contractSignDateValue])
開始
<DatePicker format="YYYY-MM-DD" placeholder="請輸入合同簽訂日期" style={{ width: '100%' }} disabledDate={disabledDateStart} />
截止
<DatePicker format="YYYY-MM-DD" placeholder="請輸入合同有效期" style={{ width: '100%' }} disabledDate={disabledDateEnd} />