title: fullcalendar add events dynamically
body: <p>I'm trying to create events in my full calendar dynamically.</p>
  
  <p>I have:</p>
  
  <pre><code>$('#calendar').fullCalendar({
                  viewRender: function (view) {
  
                      var h;
                      if (view.name == "month") {
                          h = NaN;
                      }
                      else {
                          h = 2500; // high enough to avoid scrollbars
                      }
  
  
                      $('#calendar').fullCalendar('option', 'contentHeight', h);
                  },
                  lang: 'fr',
                  events: [
                      {
                          title: '8 présents',
                          start: data[0]
                      },
                      {
                          title: '8 excusés',
                          start: data[1]
                      },
                      {
                          title: '8 excusés',
                          start: '2015-01-08'
                      },
                      {
                          title: '8 présents',
                          start: '2015-01-08'
                      },
                  ],
                  dayClick: function (date, jsEvent, view) {
                      window.location.replace(Routing.generate('dateChoisie', {date: date.format()}));
                  }
              })
  </code></pre>
  
  <p>I have a var data, which is an array that contains all the dates of the events. I want to insert this in the events in the same way I inserted data[0], data[1], etc, but dynamically for all the dates.</p>
  
  <p>I have tried to do a <code>for</code>:</p>
  
  <pre><code>events: [
      for (var i = 0, max = data.Lenght; i &lt; max; i++) {
           {
                   title: '8 présents',
                   start: data[i]
             },
      }
                                  {
                                      title: '8 excusés',
                                      start: data[1]
                                  },
                                  {
                                      title: '8 excusés',
                                      start: '2015-01-08'
                                  },
                                  {
                                      title: '8 présents',
                                      start: '2015-01-08'
                                  },
                              ],
  </code></pre>
  
  <p>But it doesn't work inside the list.</p>
  
  <p>Anybody know how I can do this?</p>