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

450
Views
ReactJS / Firebase: Save timestamp field as null value

I have a material ui date picker field that I want to allow the user to leave blank if not required.

However, ReactJS does not allow me to leave this field as empty or null, as I get the console error of:

Uncaught RangeError: Invalid time value at Date.toISOString

<LocalizationProvider dateAdapter={AdapterDateFns}>
<MobileDatePicker label={"Date From"}
inputFormat="dd/MM/yyyy"
closeOnSelect={true}
value={datefrom ?? null}
minDate={new Date()}
views={['day']}
onChange={(newValue) => {
setDateFrom(format(newValue, 'MM/dd/yyyy'));
if (dateto == '') {
setDateTo(format(newValue, 'MM/dd/yyyy'));
} }}
renderInput={(params) => <TextField variant="outlined" {...params} fullWidth />} />
</LocalizationProvider>

How do I force the item to save a timestamp field as empty/null?

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!