-1

I have this code from the google developers page and i want the users to update their calenders with it how can i do this with js and html. thanks in advance

var event = {
'summary': 'Google I/O 2015',
'location': '800 Howard St., San Francisco, CA 94103',
'description': 'A chance to hear more about Google\'s developer products.',
'start': {
    'dateTime': '2016-01-27T09:00:00-07:00',
    'timeZone': 'America/Los_Angeles'
},
'end': {
    'dateTime': '2016-01-28T17:00:00-07:00',
    'timeZone': 'America/Los_Angeles'
},
'recurrence': [
    'RRULE:FREQ=DAILY;COUNT=2'
],
'attendees': [
    {'email': 'lpage@example.com'},
    {'email': 'sbrin@example.com'}
],
'reminders': {
    'useDefault': false,
    'overrides': [
        {'method': 'email', 'minutes': 24 * 60},
        {'method': 'popup', 'minutes': 10}
    ]
}
};

var request = gapi.client.calendar.events.insert({
'calendarId': 'primary',
'resource': event
});

request.execute(function(event) {
appendPre('Event created: ' + event.htmlLink);
});

1 Answers1

0

Andrew,

The events json array describes the data object you need to fulfill.

If you intend to recreate the calendar form, you will need a text field so users can input the summary, a, optional, location field, two calendar fields so use can input a start date and a end date, and so on.

You will use js to create a json and then submit it to the api.

otaviofcs
  • 785
  • 2
  • 6
  • 16
  • how can i do all of that am a novice? – Andrew ben Richard Jan 26 '16 at 10:29
  • Andrew, a got source would be frameworks documentation. Yii2 and rails, for example, provide this documentation in a profound way. You can start here: http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html – otaviofcs Jan 26 '16 at 10:35