Example of API docs lists all events
See original GitHub issueHello all,
I’ve tried to implement the calendar API with a simple nodejs server. I just copied the quickstart exmaple form here: Google Calendara Node Quickstart
It all works fine, besides the issue, that I can’t filter any events. Instead of receiving only requested events the API lists all events in calendar:
function listEvents(auth) {
var calendar = google.calendar('v3');
calendar.events.list({
auth: auth,
calendarId: 'primary',
timeMin: (new Date()).toISOString(),
maxResults: 10,
singleEvents: true,
orderBy: 'startTime'
}, function(err, response) {
if (err) {
console.log('The API returned an error: ' + err);
return;
}
var events = response.items;
if (events.length == 0) {
console.log('No upcoming events found.');
} else {
console.log('Upcoming 10 events:');
for (var i = 0; i < events.length; i++) {
var event = events[i];
var start = event.start.dateTime || event.start.date;
console.log('%s - %s', start, event.summary);
}
}
});
}
AS response I get every single calendar entry (currently 63 items from 2014 till end of 2018). So either timeMin nor maxresults have any effect on the query… I’m doing something wrong? I currently only tested it local but it should work in debug mode as well, or?
Environment: Windows 10 Node: V8.9.2
Any tips? Or is this just a bug. To check it again, I’ve set up a new nodejs project which only contains the quickstart example file. But same result
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Use those versions and change a little something like below.
Yeah - for others that fall into this, the trick is to not install your own version of
google-auth-library
. That quickstart had some really bad advice. Just installgoogleapis
, and it will bring it’s own copy ofgoogle-auth-library
along with it 😃