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