In my google calendar I have events back to back:
- event1 9 a.m - 11 a.m
- event2 11 a.m - 13 p.m
- event3 13 p.m - 15 p.m
When I query Freebusy api it retruns one event: 9 a.m - 15 a.m rather than separate events, Why ?
Client post request:
$.post(
"url",
function (result) {
var events = [];
result.map((event, i) => {
item = {};
item["title"] = "SameTextToDisplay";
item["start"] = event.start;
item["end"] = event.end;
events.push(item);
});
}
);
My nodejs server function:
calendar.freebusy.query({
resource: {
timeMin: TimeMin,
timeMax: TimeMax,
timeZone: "America/New_York",
items: [
{
id: "MyCalendarID"
}
]
}}, (err, resp) => {
if (err) return console.log('The API returned an error: ' + err);
res.send(resp.data.calendars[id]);
});