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

177
Views
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
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!