I fear that I may have wasted a few hours tonight setting up the node-google node after reading posts on other forums about people requesting and receiving multiple calendar entries from a specified google calendar.
After getting it to all connected I failed to get more than the next calendar entry to return from each calendar that I specified.
I then noticed that when I hover over the google calendar node in node-red that is says "Return the next event in google calendar", which aligns with the documentation, but not the posts I found that showed a screenshot of an array of objects being returned - presumably each object representing an individual calendar event!
Am I barking up the wrong tree and actually need to use another node-red node or is there a parameter I am missing...
let now = new Date();
let startOfMonth = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1, 0, 0, 0));
let endOfMonth = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() + 1, 0, 23, 59, 59));
msg.topic = {
maxResults: 250,
calendarId: msg.calendar,
timeMin: startOfMonth.toISOString(),
timeMax: endOfMonth.toISOString()
};
return msg;
Before anyone jumps up and down, if I sent a msg.payload I always get a response of ""Error: no event found". I can sent msg.[anything[ and I always get the next calendar entry, so long as anything != "payload"
@knolleary @dceejay I notice you are maintainers of this node. Can you help please?
EDIT:
Interestingly I just tested the API via here: Google Event list API and I do get an array of objects in the response, so the API allows it. I suspect I am just doing something wrong with the request.