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

165
Views
¿Cómo deshabilitar/restringir al usuario para seleccionar la fecha futura y actual en el selector de fecha de arranque?

Declaración del problema: estoy usando el selector de fechas de arranque en React JS. He usado type="date" para la fecha de nacimiento y no quiero que el usuario pueda seleccionar fechas actuales o futuras. como lo puedo hacer?

Código:-

 import React from "react"; export default function DatePicker() { return ( <div> <div className="col-sm-4 col-md-3 col-lg-3 form-group required"> <label className="control-label">Date of Birth : </label> </div> <div className="col-sm-7 offset-1 col-md-8 col-lg-8"> <input className="text-uppercase input-group input-group-lg form-control" type="date" name="dob" /> </div> </div> ); }
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

puede tener propiedades de min y max , debe establecer el valor máximo hasta hoy, por lo que todas las fechas futuras estarán deshabilitadas para que las seleccionen los usuarios,

 <input name="Fecha_end" id="Fecha_end" className="text-uppercase input-group input-group-lg form-control" type="text" name="dob" max= new Date().getFullYear()+'/'+(new Date().getMonth()+1)+'/'+new Date().getDate(); />

ejemplo de trabajo completo aquí, https://jsfiddle.net/hmLpfkts/1/

about 4 years ago · Santiago Gelvez Report
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!