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

347
Views
How to create an Instant field for a date field using formik and material ui?

Hi I am creating a form using materialUI and formik. I am trying to create a Date field using TextField component that gives me back an Instant rather than a LocalDate.

The code for that field is provided below:

<Grid item xs={12} sm={12}>
 <Field
  name='Date'
  label='Date'
  type="date"
  component={TextField}
 />
</Grid>

I tried type="date" and type="datetime-local" and I am getting this error:

JSON parse error: Cannot deserialize value of type java.time.Instant from String "2022-08-23": Failed to deserialize java.time.Instant: (java.time.format.DateTimeParseException) Text '2022-08-23' could not be parsed at index 10; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize

On the materialUI website it said that type should be a valid html5 input type.

https://v4.mui.com/api/text-field/

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types

What other valid input type are there that can give me an Instant??

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