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

135
Vistas
Show only today's and upcoming days' dates to select in html input type date
<label class="whitetext">Select Date:</label>
<input type="date" class="form-control" name="pickup_date" required>

I have this input field in my html file. I want to make it such that the user can select a date starting from today only and not past dates. I think it can be done using min but I dont know how to set min to today's date.

Example-->If today is 27th October 2021, then only date 27th and all future dates are accepted as input or past dates are cancelled out or unselectable or something.

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

0

You can use setAttribute to set the min with javascript.

let today = new Date()

let year = today.getFullYear()
let month = today.getMonth() + 1 // the months are indexed starting with 0
let date = today.getDate()

let dateStr = `${year}-${month}-${date}`

let input = document.querySelector('[name=pickup_date]')
input.setAttribute('min', dateStr)
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