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

282
Views
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
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!