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

162
Views
Ingrese el tipo de tiempo cuando lo divido y lo uso manejar cambiar reaccionar minutos vienen números separados

hola alguien me puede ayudar porque los minutos vienen como separados mientras cambio tengo esta entrada

 <input type='time' name='appt-time' onChange={handleTimeChange} value={getTime(datetime)} />;

y esta funcion

 const [hours, setHours] = useState(hour); const [newMinutes, setMinutes] = useState(minutes); const handleTimeChange = (event) => { const time = event.target.value; const newTime = time.split(':'); const hour = newTime[0]; const min = newTime[1]; console.log(min); const newDatetime = format(new Date(), 'eee MMM dd yyyy ') + hour + ':' + min; const newTimestamp = new Date(newDatetime).getTime(); const timestampNow = new Date().getTime(); const isTimeValid = newTimestamp >= timestampNow; if (time) { if (isTimeValid) { setShowError(false); const newDatetime = format(new Date(datetime), "yyyy-MM-dd'T'") + time; const timeConverted = new Date(newDatetime).getTime(); setHours(hour); if (min > 60) { min = 59; } setMinutes(min); setDatetime(timeConverted); if (hour === hours && min > 9) { event.target.blur(); } } else { setShowError(true); event.preventDefault(); } } };

¿Cómo puedo hacer que ese mínimo que está en la consola sea 29, por ejemplo, no primero 2 que 9, como puede ver, intenté usar el desenfoque para hacer la validación de 99, toca afuera, pero luego con la flecha hacia arriba y hacia abajo no funciona?

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!