Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
analizar la marca de tiempo en la fecha con AvField [tipo = fecha]

Estoy usando el módulo availity-reactstrap-validation con la biblioteca de reacción,

Tengo un AvField[type=date] que obtengo una marca de tiempo de la API y quiero analizar la fecha en el valor de AvField .

He formateado la marca de tiempo con este formato: YYYY/MM/DD como se muestra a continuación:

 const scheduleDate = new Date(parseInt(candidateObject.scheduleDate)); scheduleDate: scheduleDate.getFullYear()+"-"+scheduleDate.getMonth()+"-"+scheduleDate.getDate()

Y este es el AvField :

 <AvField name="scheduleDate" type="date" placeholder="" value={innerCandidate.scheduleDate} onChange={(e) => { setInnerCandidate({ ...innerCandidate, scheduleDate: e.target.value }) }} />

por alguna razón, el campo permanece con su marcador de posición, pero mantiene la nueva fecha en el valor.

aquí está el código completo que recibe y actualiza los datos:

 const CandidateForm = ({candidateObject = {}, history, handleSubmitForm}) => { const [innerCandidate, setInnerCandidate] = useState({}) const [departmentList, setDepartmentList] = useState([]) const [userPermission, setUserPermission] = useState(0) useEffect(() => { setUserPermission(localStorage.getItem("permission")); if (Object.keys(candidateObject).length > 0) // if exists update the state. //UPDATE COMPONENT { const scheduleDate = new Date(parseInt(candidateObject.scheduleDate)); const modifyiedCandidateObject = { ...candidateObject, scheduleDate: scheduleDate.getFullYear()+"-"+scheduleDate.getMonth()+"-"+scheduleDate.getDate() } setInnerCandidate(modifyiedCandidateObject) } // eslint-disable-next-line react-hooks/exhaustive-deps }, [candidateObject.id]) return () }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!