diff --git a/quickstart.py b/quickstart.py index 54c1529..bd95daf 100644 --- a/quickstart.py +++ b/quickstart.py @@ -40,6 +40,7 @@ def getCalendarEvents(service, startDate, endDate): while True: calendar_list = service.calendarList().list(pageToken=page_token).execute() for calendar_list_entry in calendar_list['items']: + print(calendar_list_entry['colorId']) calendar_ids.append(calendar_list_entry['id']) page_token = calendar_list.get('nextPageToken') if not page_token: @@ -63,8 +64,8 @@ def main(): now = datetime.datetime.now() now = now.replace(hour=00, minute=00) today = now.isoformat() + 'Z' # 'Z' indicates UTC time - one_day = datetime.timedelta(days=1) - tomorrow = (now + one_day).isoformat() + 'Z' + # one_day = datetime.timedelta(days=1) + tomorrow = (now.replace(hour=23, minute=59, second=59)).isoformat() + 'Z' all_events = getCalendarEvents(service, today, tomorrow) @@ -72,8 +73,10 @@ def main(): # print('No upcoming events found.') for event_list in all_events: for event in event_list: - start = event['start'].get('dateTime', event['start'].get('date')) - print(start, event['summary']) + start = event['start'].get('dateTime') + color = event.get('colorId') + end = event['end'].get('dateTime') + print(start, " ", end, color, event['summary']) if __name__ == '__main__': diff --git a/token.pickle b/token.pickle index 84c4373..76117d9 100644 Binary files a/token.pickle and b/token.pickle differ