To create engaging applications with various calendar features, you must learn to add events to calendars in the batch mode:
Retrieve the default system calendar using the getDefaultCalendar() method of the CalendarManager interface:
calendar = webapis.calendar.getDefaultCalendar("EVENT");
Define the items to be added as an array:
var ev = new webapis.CalendarEvent ({ description:"HTML5 Introduction", summary:"HTML5 Webinar", startDate: new webapis.TZDate(2011, 3, 30, 10, 0), duration: new webapis.TimeDuration(1, "HOURS"), location:"Huesca" });
Note To keep the example as simple as possible, the defined ev array includes only 1 event. Use the addBatch() method of the Calendar object to add the events in the array to the calendar:
calendar.addBatch([ev]);