Browse Source

fix plan start & plan end

develop
cyril.tsui 6 months ago
parent
commit
2c104d88a5
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/components/CreateProject/ProjectClientDetails.tsx

+ 4
- 4
src/components/CreateProject/ProjectClientDetails.tsx View File

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


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


Loading…
Cancel
Save