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

676
Vistas
Format date to correct date format in React

I am currently working with a React Kendo Grid which is filled with data by an API. On of the columns is Date and the data filling it comes in a format like:

2022-02-11T15:50:51.000+00:00   

I tried to format the Kendo Grid column like this:

 <GridColumn
                field="snDate"
                filter="date"
                format="{0:yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}"
                width="200px"
                title="Date" 
              />

but when I filter it with Kendo datapicker filter, it returns no rows. What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to make a custom column compoenet and play with the date over there:

const DateCell = ({ myDate }) => { 
  const [year, month, day] = myDate.split('T')[0].split('-');
  const time_part = myDate.split('T')[1];

  return (
        <td>
            {`${year}/${month}/${day} ${time_part}`}
        </td>
    )
}
//export default DateCell //this is if you want to put it in separate component



<GridColumn
   field="snDate"
   filter="date"
   width="200px"
   title="Date" 
   cell={DateCell}
/>

My result is -> 2022/06/19 10:35:13.197

And when you filter it React Kendo Grid knows that the value of each cell is in the first format that you mentioned, I mean to the 2022-02-11T15:50:51.000+00:00 and the filter will work. It's worked for me. Good luck

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