Ver código fonte

fix plan start & plan end

develop
cyril.tsui 6 meses atrás
pai
commit
2c104d88a5
1 arquivos alterados com 4 adições e 4 exclusões
  1. +4
    -4
      src/components/CreateProject/ProjectClientDetails.tsx

+ 4
- 4
src/components/CreateProject/ProjectClientDetails.tsx Ver arquivo

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


Carregando…
Cancelar
Salvar