Skip to content

Instantly share code, notes, and snippets.

@rcknr
Created June 23, 2011 21:34
Show Gist options
  • Save rcknr/1043690 to your computer and use it in GitHub Desktop.
Save rcknr/1043690 to your computer and use it in GitHub Desktop.
Quick add event to Calendar using GData
// Set the feed URL
var EVENT_FEED_URL = 'http://www.google.com/calendar/feeds/default/private/full';
// Create a calendar object
var calendarService = new google.gdata.calendar.CalendarEventEntry();
// Create a new event handler
var quickEvent = new google.gdata.calendar.CalendarEventEntry();
// Create a new property handler and set it to true
var quickAdd = new google.gdata.calendar.QuickAddProperty();
quickAdd.setValue(true);
// Set a string from which quick event will be created
quickEvent.setContent(google.gdata.atom.Text.create('A meeting tomorrow at 18:00'));
// Attach the property to the event
quickEvent.setQuickAdd(quickAdd);
// Create the event
calendarService.insertEntry(EVENT_FEED_URL, quickEvent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment