Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

421
Vistas
Force user to enter only hours in Input=Time and disable Minutes

In my application the Time will always be like HH/00/00. So users will only need to enter the hour value as the minutes will be 00. I could not find a way to change the format of the input=time to only HH.

I found some articles about assigning step value but it doesn't work.

Any idea about preventing users to select minutes and force him to only select hours?

<div class="md-form mx-5 my-5">
    </div>

  <label>Choose your time</label>
  <input type="time"  /

Time

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

How about some JS code ? a simple one really, like the one below, you can add more conditions to make it much more strict, but here you go:

const timeInput = document.getElementById('time');

timeInput.addEventListener('input', (e) => {
  let hour = e.target.value.split(':')[0]
  e.target.value = `${hour}:00`
})
<div class="md-form mx-5 my-5">
    </div>

  <label>Choose your time</label>
  <input id="time" type="time">

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda