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

283
Vistas
Get data from firestore and transform it into an Object in order to render it in agenda from calendars library

i have created 2 diferent collections one for users another one for Usertasks in my databasefirestore db. The structure is Usertasks( Collection)- >userid (document)->documents (collection)->taskId(document)->the task date string, name id and status (collection ) I am attaching a picture for better understanding firestore db

The thing is i need to create "{items} " in order to be able to render it in the agenda events, items are like this

Object {
  "2017-05-20": Array [
    Object {
      "name": "Meetin Juan",
    },

This is what i have in my database


Array [
  Object {
    "dateString": "2017-04-27",
    "id": "1638540202073 }",
    "name": "Jajajajaaaaa",
    "status": false,
  },

So i pass this function to my db data to get what i need;

transform =() => {
  //console.log("porfavor",(data))
  let item ={}

  const itemList = []
  data.forEach(element => {
    item={
      [element.dateString]:{
      id : element.id,
      name : element.name,
      status : element.status
    }
  }
  itemList.push(item)
});
console.log("this is the itemlist ",itemList)

setItemList(itemList)

}

And thats what i get but i dont think is right as i get errors when i say const items=props.itemList and nothing is displayed just too many renders error

Array [
  Object {
    "2017-04-27": Object {
    "id": "1638540202073 }",
    "name": "Jajajajaaaaa",
    "status": false,
  },
},

How can i do it?

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