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

179
Vistas
How to set onChange for KeyboardDatePicker in JalaliUtils?

I use material-ui/pickers And the datetime I want to have is jalali.This is the code I used:

import jMoment from "moment-jalaali";
import JalaliUtils from "@date-io/jalaali";
import {
  DatePicker as MuiDatePicker,
  MuiPickersUtilsProvider,
  KeyboardDatePicker,
  KeyboardDateTimePicker
} from "@material-ui/pickers";


 const [selectedDate, handleDateChange] = useState(new Date);

 return (
      <MuiPickersUtilsProvider utils={JalaliUtils} locale="fa">
       <KeyboardDateTimePicker
          ampm={false}
          disablePast
          //format="jYYYY/jMM/jDD HH:mm:ss"
          utils={JalaliUtils}
          fullWidth
          name={props.name}
          label={props.label}
          variant="inline"
          inputVariant="outlined"
          autoOk
          labelFunc={(date) => (date ? date.format("jYYYY/jMM/jDD hh:mm:ss") : "")}
          id={props.id}
          value={selectedDate}
          onChange={handleDateChange}
        />
        </MuiPickersUtilsProvider>

The datetime changes when I select a datetime enter image description here

but when I try, I can not override the date with the keyboard.

enter image description here

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