2014-03-31 3 views
0

2014-03-31과 2014-04-07 사이에 내 일정의 모든 일정을 가져 와서 해당 날짜를 요청하려고합니다. 그러나 그것은 250 개의 이벤트를 제공합니다. 첫 번째 이벤트는 2012-02-20입니다.시작일과 종료일별로 gapi 캘린더 일정이 작동하지 않음

제가 생각할 수있는 유일한 점은 시작과 끝 필터를 무시한다는 것입니다. 내가 오타를 만들었 는가, 매개 변수를 잘못 사용했거나 무슨 일이 일어 났는가? 나는 아무 소용 aswell 다음과 같은 형식을 시도했습니다

function getEvents(calendarId) { 
    gapi.client.load('calendar', 'v3', function() { 
     var request = gapi.client.calendar.events.list({ 
      calendarId: calendarId, 
      start: '2014-03-31', 
      end: '2014-04-07' 
     }); 

     request.execute(function(resp) { 
      console.log(resp.items.length); 
     }); 
    }); 
} 

:

"start": { 
    "date": date 
} 

답변

0

https://developers.google.com/google-apps/calendar/v3/reference/events/list

API 문서는 날짜 매개 변수를 지정 - 어쩌면 자동으로 유효로 문자열을 변환 할 정도로 똑똑하지 날짜, 시도 :

function getEvents(calendarId) { 
    gapi.client.load('calendar', 'v3', function() { 
     var request = gapi.client.calendar.events.list({ 
      calendarId: calendarId, 
      start: new Date("2014-03-31").toISOString(), 
      end: new Date("2014-04-07").toISOString() 
     }); 

     request.execute(function(resp) { 
      console.log(resp.items.length); 
     }); 
    }); 
} 
관련 문제