Ver a proveniência

fix plan start & plan end

develop
cyril.tsui há 6 meses
ascendente
cometimento
2c104d88a5
1 ficheiros alterados com 4 adições e 4 eliminações
  1. +4
    -4
      src/components/CreateProject/ProjectClientDetails.tsx

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

@@ -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
Guardar