Node.js Quickstart example in Google Calendar API is not working with parameters
See original GitHub issueHi,
In Google Calendar API Node.js Quickstart example, when calendar.events.list()
method is called with different parameters values for timeMin
and maxResults
, returned result is not affected with these changes.Always returns my all events.
function listEvents(auth) {
var calendar = google.calendar('v3');
calendar.events.list({
auth: auth,
calendarId: 'primary',
timeMin: (new Date()).toISOString(),
maxResults: 4,
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 4 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);
}
}
});
}
But it is working in APIs Explorer.
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How to fix Google Calendar API error - node.js - Stack Overflow
Select the application type Other, enter the name "Google Calendar API Quickstart", and click the Create button. Click OK to dismiss the resulting...
Read more >JavaScript quickstart | Google Calendar
In the Google Cloud console, go to Menu menu > APIs & Services > Credentials. Go to Credentials. Click Create Credentials > OAuth...
Read more >Google Auth Library: Node.js Client
For the example below, you must enable the DNS API . Choosing the correct credential type automatically. Rather than manually creating an OAuth2 ......
Read more >Google APIs Node.js Client - googleapis documentation
Support for authorization and authentication with OAuth 2.0, API Keys and JWT tokens is included. Google APIs; Getting started. Installation; Using the client ......
Read more >Google Calendar API with NodeJS | Step by Step - YouTube
Hello everyone,In this video, I will talk about how you can use Google Calendar API with NodeJS step by step.Step 1 - Create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Greetings! The quickstart is out of date. We’re working to fix that 😃 You just need to change this:
To this:
Apologies for the trouble, and hope this helps!
After a long time of googling I found the solution at stackoverflow. The way you have to define the query has changed. Have a look at this thread: https://stackoverflow.com/questions/48488105/google-calendar-api-v3-doesnt-respect-timemin-timemax-parameters-in-nodejs-expr