Hi, I posted a response on your post about how to insert using JS API here -
http://groups.google.com/group/google-calendar-help-dataapi/browse_thread/thread/23fb448d4e6ff6ba Thanks, Austin On Jan 24, 2008 3:18 AM, fangyiee <[EMAIL PROTECTED]> wrote: > > Hi , > > I am stuck with this problem since last week, i jux cant figure out > where it go wrong. I am trying to insert a "static" value into my > calendar. > I am very unclear of the this code > > event.setDateT(google.gdata.DateTime.fromIso8601("2008-01-30T18:00:00.000Z > ")); > > isnt in the right syntax?? > > Below is my codes: > > <html> > <head> > <script type="text/javascript" src="http://www.google.com/jsapi? > key=ABQIAAAA64DBAV34z1d6Sk2uOcPMKBR1XU7oKMwY3ZhA- > eKHJ4aWM1U5vRTpUqOXGunp9DX4HD-opTjbnshUeA"></script> > <script type="text/javascript"> > > google.load("gdata", "1.x"); > var feedUrl = "http://www.google.com/calendar/feeds/default/private/ > full"; > > function init() { > > var token = google.accounts.user.checkLogin(feedUrl); > > myService = new google.gdata.calendar.CalendarService('Workshop > Calendar'); > > var authButton = document.getElementById('auth_button'); > var insert = document.getElementById('insert'); > > if (google.accounts.user.checkLogin(feedUrl)) { > authButton.value = 'Logout'; > insert.style.visibility = 'visible'; > > } else { > authButton.value = 'Login'; > } > }; > > function loginOrLogout(){ > var token = google.accounts.user.checkLogin(feedUrl); > if (token) { > google.accounts.user.logout(); > init(); > } else { > google.accounts.user.login(feedurl); > } > } > > google.setOnLoadCallback(init); > > > function getMyFeed() { > > myService.getEventsFeed(feedUrl, handleMyFeed, > handleError); > > } > > function insertIntoMyFeed(feedRoot) { > > var event = new google.gdata.calendar.CalendarEventEntry(); > event.setTitle(google.gdata.Text.create('TRY TRY > Workshop')); > > event.setContent(google.gdata.Text.create('Workshop Content > HERE')); > > event.setDateT(google.gdata.DateTime.fromIso8601("2008-01-30T18:00:00.000Z > ")); > > feedRoot.insertEntry(feedUrl, event, handleMyInsertedEntry, > handleError); > > } > > function handleMyFeed(myResultsFeedRoot) { > alert("This feed's title is: " + > myResultsFeedRoot.feed.getTitle().getText()); > insertIntoMyFeed(myResultsFeedRoot); > } > > function handleError(e) { > alert("There was an error!"); > alert(e.cause ? e.cause.statusText : e.message); > } > > > > function handleMyInsertedEntry(insertedEntryRoot) { > alert("Entry inserted. The title is: " + > insertedEntryRoot.entry.getTitle().getText()); > alert("The timestamp is: " + > insertedEntryRoot.entry.getTimes()[0].startTime); > } > > </script> > </head> > <body> > <input id="auth_button" type="button" value="Login" > onclick="loginOrLogout()" style="margin:5px 0px 5px 0px;"/> > <input id="insert" type="button" value="create Event" > onclick="getMyFeed()" style="visibility: hidden"/> > </body> > </html> > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
