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

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