1

I use api google to get the event list from google on my project. My code is

this.getEvents = function(startDate, maxDate) {
  gapi.client.load('calendar', 'v3', function() {
    var request = gapi.client.calendar.events.list({
      'calendarId': 'primary',
      'timeMin': (new Date(startDate)).toISOString(),
      'timeMax': (new Date(maxDate)).toISOString(),
      'showDeleted': false,
      'singleEvents': true,
      'orderBy': 'startTime',
    })
    request.execute(function(response) {
      if (!response.error) {
        deferred.resolve(response.items);
      } else {
        deferred.reject('error');
      }
    });

  })
  return deferred.promise;
}

When I load for the first time, the event is loaded, but when I add the edit delete and call back funtion getevents, the events do not change until I reload the page. how can i fix it

Jeremy
  • 93
  • 9

0 Answers0