Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

274
Visualizações
React/FullCalendar : How can I map data from an API to events and resources dynamically?

I am trying to develop a new app in React, where I display on a Fullcalendar, working shifts. I get the data from an endpoint and then I want to dynamically pass them into the events and resources of the FullCalendar.io. The response is populated with strings and arrays.

I figured out how Fullcalendar.io maps events to resources (resourceId:). Now I want to map the response to the corresponding fields in events and resources. I have done this to render some results to a list :

shiftData.map((id) => <option key={shiftData.ShiftId} value={shiftData.ShiftId}> {shiftData.ShiftId} </option>)

I want to do the same for the Events and Resources in Fullcalendar.io and I am trying to figure out a way to do so dynamically.

 resources={[
               { 
                  id: `${shiftData.DisplayName }`,
                  resourceId:  'Name Surname',
                  building: ` ${shiftData.JobTitle}`,
                  title: ` ${shiftData.DisplayName }`,
                  businessHours: {
                  startTime:  shiftData[0].StartDateTime,
                  endTime: shiftData[0].EndDateTime
                  }
               }
}]
  events={[
          {  
             title: ` ${shiftData.DisplayName }`, 
             resourceId: ` ${shiftData.DisplayName === 'Name Surname'}`, 
             start: shiftData[0].ShiftCheckIn,
             end: shiftData[0].ShiftCheckOut
         }

So what i did in the above sample, is check for the name of the employee and map it with a hardcoded resource. But that doesn't work obviously. That is what I am trying to figure out. How can I map dynamically data. Note that when I indicate the array position [0], I can get the results but I want to do it dynamically, for all objects/properties in the response.

Thank you in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda