Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
creating a contact's event in java
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
tred  
View profile  
 More options Apr 22 2012, 8:12 pm
From: tred <tredmesht...@gmail.com>
Date: Sun, 22 Apr 2012 17:12:04 -0700 (PDT)
Local: Sun, Apr 22 2012 8:12 pm
Subject: creating a contact's event in java
I'm going in circles trying to get an event created for a contact.  I
create the contact and send it to google but receive a:

"Bad Request When element does not have start date set or it&#39;s
malformed."

Seems to be related to the date of the When in the addEvent().
Documentation says "Only the @startTime attribute is supported.
Furthermore, its value must be a pure date, without the time
component."

Code I'm using is like this:
==============================================

//per documentation: Exactly one of the label and rel attributes must
be provided.
Event event = new Event(null, Event.Rel.ANNIVERSARY) ;

//convert a date string to a date
SimpleDateFormat formatter = new SimpleDateFormat("EEE, d MMM yyyy");
Date date = (Date)f ormatter.parse(pojo.anniversary);  // date is a
string formatted  like "Mon, 25 Dec 2000 00:00:00 +0000"

When w = new When();
w.setStartTime( new DateTime( date ));
x.setWhen( w );

contact.addEvent(event);

==============================================

What am I missing?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tred  
View profile  
 More options Apr 22 2012, 8:37 pm
From: tred <tredmesht...@gmail.com>
Date: Sun, 22 Apr 2012 17:37:07 -0700 (PDT)
Local: Sun, Apr 22 2012 8:37 pm
Subject: Re: creating a contact's event in java
got it..hidden property in the DateTime.

DateTime dateTime = new DateTime(date);
dateTime.setDateOnly(true);

On Apr 22, 6:12 pm, tred <tredmesht...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »