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

453
Vistas
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
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