{"action":"created","issue":{"url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/977","repository_url":"https://api.github.com/repos/google/google-api-nodejs-client","labels_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/977/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/977/comments","events_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/977/events","html_url":"https://github.com/google/google-api-nodejs-client/issues/977","id":293032391,"number":977,"title":"Calendar API V3 doesn't respect timeMin timeMax parameters in nodejs Express application","user":{"login":"NU-OnE","id":16491972,"avatar_url":"https://avatars0.githubusercontent.com/u/16491972?v=4","gravatar_id":"","url":"https://api.github.com/users/NU-OnE","html_url":"https://github.com/NU-OnE","followers_url":"https://api.github.com/users/NU-OnE/followers","following_url":"https://api.github.com/users/NU-OnE/following{/other_user}","gists_url":"https://api.github.com/users/NU-OnE/gists{/gist_id}","starred_url":"https://api.github.com/users/NU-OnE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NU-OnE/subscriptions","organizations_url":"https://api.github.com/users/NU-OnE/orgs","repos_url":"https://api.github.com/users/NU-OnE/repos","events_url":"https://api.github.com/users/NU-OnE/events{/privacy}","received_events_url":"https://api.github.com/users/NU-OnE/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-01-31T05:04:55Z","updated_at":"2018-05-14T01:33:16Z","closed_at":"2018-02-03T15:06:45Z","author_association":"NONE","body":"I've managed to get all events between two dates as mentioned in quickstart example on pure nodeJs environment.\r\n\r\nBut when i use same cording with nodeJs Express App, It doesn't respect the timeMin and timeMax parameters.\r\n\r\nInstead, i get all the events from the date that i created first event on calendar. Here is my code block looks like.\r\n\r\n\r\n```\r\nfunction listEvents(auth) {\r\n  var calendar = google.calendar('v3');\r\n  calendar.events.list({\r\n    auth: auth,\r\n    calendarId: 'primary',\r\n\r\n    timeMin: (new Date(Date.parse(\"2018-01-22\"))).toISOString(),\r\n    timeMax: (new Date(Date.parse(\"2018-02-27\"))).toISOString(),\r\n\r\n    singleEvents: true,\r\n    orderBy: 'startTime'\r\n  }, function(err, response) {\r\n    if (err) {\r\n      console.log('The API returned an error: ' + err);\r\n      return;\r\n    }\r\n    var events = response.items;\r\n    if (events.length === 0) {\r\n      console.log('No upcoming events found.');\r\n    }\r\n    else {\r\n       // Do Some Stuff ...............\r\n    }\r\n  });\r\n}\r\n```\r\n\r\nWhat am i missing here..?\r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/comments/388673096","html_url":"https://github.com/google/google-api-nodejs-client/issues/977#issuecomment-388673096","issue_url":"https://api.github.com/repos/google/google-api-nodejs-client/issues/977","id":388673096,"user":{"login":"Lovinity","id":11471458,"avatar_url":"https://avatars3.githubusercontent.com/u/11471458?v=4","gravatar_id":"","url":"https://api.github.com/users/Lovinity","html_url":"https://github.com/Lovinity","followers_url":"https://api.github.com/users/Lovinity/followers","following_url":"https://api.github.com/users/Lovinity/following{/other_user}","gists_url":"https://api.github.com/users/Lovinity/gists{/gist_id}","starred_url":"https://api.github.com/users/Lovinity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lovinity/subscriptions","organizations_url":"https://api.github.com/users/Lovinity/orgs","repos_url":"https://api.github.com/users/Lovinity/repos","events_url":"https://api.github.com/users/Lovinity/events{/privacy}","received_events_url":"https://api.github.com/users/Lovinity/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T01:33:16Z","updated_at":"2018-05-14T01:33:16Z","author_association":"NONE","body":"NVM I remedied this issue by switching to async await calls instead of using sync. It looks like in v30 at least, qs and params are not used; params are passed directly into the function as an object argument.\r\n\r\n`                var events = await calendar.events.list({\r\n                    calendarId: 'secret',\r\n                    timeMin: currentdate.toISOString(),\r\n                    timeMax: nextWeekDate.toISOString(),\r\n                    singleEvents: true\r\n                });`"}}
{"actor":{"display_login":"Lovinity"}}