Hi,
This how you insert event using the JS Client Library -

// INSERT EVENT

var feedUri = 'http://www.google.com/calendar/feeds/default/private/full';

var title = 'test';
var where = 'here';
var content = 'blah';
var startTime = '2008-02-06T18:00:00.000Z';
var endTime = '2008-02-06T19:00:00.000Z';

var newEvent = new google.gdata.calendar.CalendarEventEntry({
  title: {type: 'text', text: title},
  content: {type: 'text', text: content},
  locations: [
    {
      rel: 'g.event',
      label: 'Event location',
      valueString: where
    }],
  times: [
    {
      startTime:
          google.gdata.DateTime.fromIso8601(startTime),
      endTime:
          google.gdata.DateTime.fromIso8601(endTime)
    }]
  }
);

var callback = function(root) {
    root.feed.insertEntry(
      newEvent,
      function(root) {
        PRINT('event is inserted!');
      },
      handleError
    );
  };

calendarService.getEventsFeed(
  feedUri,
  callback,
  handleError
);

Hope it helps,
Austin



On Feb 5, 2008 7:39 PM, warrenjb <[EMAIL PROTECTED]> wrote:

>
> Need help with why the attached is successfully deleting but not
> inserting? Thanks.
>
> <script>
> google.load("gdata", "1.x");
> google.setOnLoadCallback(getMyFeed);
> var aptyp = 1;
> var feedUrl = "http://www.google.com/calendar/feeds/default/private/
> full";
> function setupMyService() {
>  var myService =
>    new google.gdata.calendar.CalendarService('exampleCo-
> exampleApp-1');
>  return myService;
> }
> function getMyFeed() {
>        myService = setupMyService();
>        searchMyFeed();
> }
> function searchMyFeed() {
>        var myQuery = new google.gdata.calendar.CalendarEventQuery
> (feedUrl);
>        myQuery.setFullTextQuery("Vis 1");
>        var callback = function(root) {
>                var entries = root.feed.getEntries();
>                        if (entries.length > 0) {
>                                entries[0].deleteEntry(
>                                        function() {
>                                        alert('Updated');
>                                        },
>                                handleError
>                        );
>            }
>        };
> myService.getEventsFeed(myQuery,callback);
> insertIntoMyFeed();
> }
> function insertIntoMyFeed() {
>  if (aptyp * 1 < 10 ) {
>  var newEntry = new google.gdata.calendar.CalendarEventEntry({
>    authors: [
>      {
>        name: "usrnm",
>        email: "[EMAIL PROTECTED]"
>      }
>    ],
>    title: {type: 'text', text: "Type: 1"},
>    content: {type: 'text', text: "Vis 1"},
>    locations: [
>      {
>        rel: "g.event",
>        label: "Event location",
>        valueString: "Of 1"
>      }
>    ],
>    times: [
>      {
>        startTime:
>
> google.gdata.DateTime.fromIso8601('2008-01-31T18:00:00.000Z'),
>        endTime:
>
> google.gdata.DateTime.fromIso8601('2008-01-31T19:00:00.000Z')
>      }
>    ]
>    }
>  );
> myService.getEventsFeed(feedUrl,function(root)
> {root.feed.insertEntry(newEntry);});
> };
> }
> </script>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to