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

247
Views
cómo deshabilitar el tiempo futuro en material-ui KeyboardDateTimePicker en reactjs

Estoy usando Material UI KeyboardDateTimePicker y al usar disabledFuture pude deshabilitar la fecha futura, pero también quiero deshabilitar la hora futura . cualquier solución sería apreciada

 import { KeyboardDateTimePicker } from "@material-ui/pickers"; <KeyboardDateTimePicker color="primary" disableFuture format="yyyy-MM-dd hh:mm a" label={intl.formatMessage({ id: "end" })} margin="normal" onChange={(x) => onChange({ from, to: x?.toJSDate() ?? null })} value={to} variant="inline" maxDate={new Date()} />

Nota: no quiero actualizar la biblioteca

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede validar el valor usted mismo pasando un mensaje de error al componente Textfield subyacente, si la fecha y la hora están en el futuro.

 <KeyboardDateTimePicker value={to} error={dateTimeIsInFuture(to)}

A continuación, puede agregar un mensaje de error personalizado utilizando la propiedad helperText : reaccionar material - validación de campo de texto de interfaz de usuario: establecer mensajes de error personalizados .

about 4 years ago · Juan Pablo Isaza 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!