Trouble with populate an api response into a calendar

Hello Guys :slight_smile:

My main goal is too populate api data inside a calendar. And my api response look like this :

First Try

[{"id":"Gfcp28z","date":"2022-02-16","hourminute":"17:00", "duration":"03:30","personnel":"5325","nomSalarie":"ABDELLAOUI","prenomSalarie":"SADIA","chantier":"27393","title":"POLE SANTE TRAVAIL DE TOURCOING RAYMOND POINCARE","prestation":"4","codePrestation":"ENTRE","libellePrestation":"FORFAIT ENTRETIEN","commentaireIntervention":"","rubrique":"21","codeRubrique":"101","libelleRubrique":"Salaire de base mensuel"}]

from this array {{['0']}}

When i remove"[0]" from the query, i retrieve all my events in my calendar and not just this first event in my api response. But.

As you see, the date is correct but i can't specify when the event start/end + i can't custom the title.

Second Try

In the calendar component, i put this query :

  id: {{['0'].id}},
  title: {{['0'].nomChantier}},
  start:  {{ moment().hours( }},
  end: {{ moment().hours( }}

I use here the "Standard" method and create custom query in javascript to extract only the hour
( :

const data = {
  {{['0'].hourminute.substring(0, 2)}}
return data

and the minutes ( :

const data = {
return data


of my event + calculate the end of my event :

End hour ( :

  var hourstart = {{['0'].hourminute.substring(0, 2)}};
  var durationhour = {{['0'].duration['1']}}
  const  total = ((hourstart || 0) * 1) + ((durationhour|| 0) * 1) ;
  return total;

End minutes ( :

 var minutestart = {{['0'].hourminute.substring(3)}};
  var durationminute = {{['0'].duration.substring(3)}}
  const  total = ((minnutestart || 0) * 1) + ((durationminute|| 0) * 1) ;
  return total;

So it partially work but i can't retrieve all my event, just the first event in my api response

How can i do to retrieve all my events in the calendar ?


up please :slight_smile:

up please guys

Hi @yamasammy

Thanks for reaching out!

That is helpful that you have this working for one event! It sounds like you may need to use Javascript to loop through all of your other events and refactor each one: