js/calendar.js
/**
* Print the summary and start datetime/date of the next ten events in
* the authorized user's calendar. If no events are found an
* appropriate message is printed.
*/
Print the summary and start datetime/date of the next ten events in
the authorized user's calendar. If no events are found an
appropriate message is printed.
Print the summary and start datetime / date of the next ten events in the authorized user ' s calendar . If no events are found an appropriate message is printed .
function listUpcomingEvents() {
	var request = gapi.client.calendar.events.list({
        'calendarId': 'primary',
        'timeMin': (new Date()).toISOString(),
        'showDeleted': false,
        'singleEvents': true,
        'maxResults': 10,
        'orderBy': 'startTime'
	});
    request.execute(function(resp) {
        var events = resp.items;
        clearPre();
        if (events.length > 0) {
            appendPre(htmlForCalendarEventList(events));
        } else {
            appendPre('No upcoming events found.');
        }
    });
}
function listUpcomingEvents ( ) { var request = gapi . client . calendar . events . list ( { 'calendarId' : 'primary' , 'timeMin' : ( new Date ( ) ) . toISOString ( ) , 'showDeleted' : false , 'singleEvents' : true , 'maxResults' : 10 , 'orderBy' : 'startTime' } ) ; request . execute ( function ( resp ) { var events = resp . items ; clearPre ( ) ; if ( events . length > 0 ) { appendPre ( htmlForCalendarEventList ( events ) ) ; } else { appendPre ( 'No upcoming events found.' ) ; } } ) ; }
Print the summary and start datetime/date of the next ten events in
the authorized user's calendar.
Print the summary and start datetime / date of the next ten events in the authorized user ' s calendar .