ソースを参照

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


読み込み中…
キャンセル
保存