瀏覽代碼

fix plan start & plan end

develop
cyril.tsui 6 月之前
父節點
當前提交
2c104d88a5
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. +4
    -4
      src/components/CreateProject/ProjectClientDetails.tsx

+ 4
- 4
src/components/CreateProject/ProjectClientDetails.tsx 查看文件

@@ -242,18 +242,18 @@ const ProjectClientDetails: React.FC<Props> = ({
// (acc, wn) => ({ ...acc, [wn.id]: wn.name }),
// {},
// );
const planStart = getValues("projectPlanStart")
const planEnd = getValues("projectPlanEnd")
const planStart = watch("projectPlanStart")
const planEnd = watch("projectPlanEnd")

useEffect(() => {
let hasErrors = false
if(
!planStart || planStart > planEnd
!planStart || new Date(planStart) > new Date(planEnd)
){
hasErrors = true;
}
if(
!planEnd || planStart > planEnd
!planEnd || new Date(planStart) > new Date(planEnd)
){
hasErrors = true;
}


Loading…
取消
儲存