Index: servers/google/libgdata/gdata-entry.c
===================================================================
--- servers/google/libgdata/gdata-entry.c	(revision 8620)
+++ servers/google/libgdata/gdata-entry.c	(working copy)
@@ -67,6 +67,8 @@
 	GSList *links;
 	GHashTable *field_table;
 	GSList *attendees;
+	GDataRecurrence *recur;
+
 	gchar *location;
 	gchar *content;
         gchar *title;
@@ -77,16 +79,22 @@
 	gchar *end_time;
 	gchar *send_notification;
 	gchar *transparency;
+	gchar *zone_info;
 	gchar *id;
-
+		
 	gboolean entry_needs_update;
 	gboolean has_attendees;
 	gchar *entry_xml;
+	gchar *recur_string;
 
 	gboolean dispose_has_run;
 	gboolean is_recurrent;
+	gboolean is_all_day;
 };
 
+static void recur_set (gpointer data, gpointer user_data);
+gchar * recurrence_as_recur_string (GDataRecurrence *recur, gchar *zone_info, gboolean all_day);
+
 static void destroy_authors (gpointer data, gpointer user_data)
 {
 	GDataEntryAuthor *author = (GDataEntryAuthor *)data;
@@ -141,6 +149,26 @@
 	g_free(link);
 }
 
+static void destroy_recur (GDataRecurrence *recur)
+{
+	if (recur->rvals)
+		g_free (recur->rvals);
+	
+	if (recur->rrule)
+		g_free (recur->rrule);
+		
+	if (recur->startt)
+		g_free (recur->startt);
+
+	if(recur->endt)
+		g_free (recur->endt);
+
+	if(recur->exdate)
+		g_free (recur->exdate);
+
+	g_free (recur);
+}
+
 enum {
 	PROP_0,
 };
@@ -206,6 +234,9 @@
 		g_slist_free(priv->categories);
 	}
 
+	if (priv->recur) 
+		destroy_recur (priv->recur);
+
 	if (priv->field_table != NULL)
 		g_hash_table_destroy(priv->field_table);
 
@@ -475,6 +506,162 @@
 	return category_node;
 }
 
+static void 
+recur_set (gpointer data, gpointer user_data)
+{
+	GDataRecurrence *recur;
+	gchar *rstr = NULL, *date = NULL, *rule = NULL;
+
+	rstr = (gchar *)data;
+	recur = (GDataRecurrence *)user_data;
+	
+	if (strstr(rstr, "DTSTART") && strstr(rstr, "TZID")) {
+		date = strstr (rstr, ":");
+		date++;
+		if (date)
+			recur->startt = g_strdup (date);
+	}
+	
+	/* For all day events , that does not have timezone information. RFC 2445 */
+	if (strstr(rstr, "DTSTART") && strstr(rstr, "VALUE")) {
+		date = strstr (rstr, ":");
+		date++;
+		if (date)		
+			recur->startt = g_strdup (date);
+	}
+	
+	if (strstr(rstr, "DTEND") && strstr(rstr, "TZID"))  {	
+		date = strstr (rstr, ":");
+		date++;
+		if (date)
+			recur->endt = g_strdup (date);	
+	}
+
+	/* For all day events , that does not have timezone information. RFC 2445 */
+	if (strstr(rstr, "DTEND") && strstr(rstr, "VALUE")) {
+		date = strstr (rstr, ":");
+		date++;
+		if (date)
+			recur->endt = g_strdup (date);
+	}	
+	
+	if (strstr(rstr, "RRULE")) {
+		rule = strstr (rstr, ":");
+		rule++;
+		if (rule)
+			recur->rrule = g_strdup (rule);
+	}
+
+	if (strstr(rstr, "EXDATE")) {
+		date = strstr(rstr, ":");
+		date++;
+		if (rule) 
+			recur->exdate = g_strdup (date);	
+	}
+}	
+
+
+static GDataRecurrence * 
+recur_string_to_recurrence (gchar *rstr)
+{
+	GDataRecurrence *recur = NULL;
+	GList *rvals = NULL;
+	gchar *val;
+	
+	g_return_val_if_fail (rstr != NULL, NULL);	
+	recur = g_new0 (GDataRecurrence, 1);
+
+	/*Recur values */
+	while (rstr)
+	{
+		val = strsep (&rstr, "\n");		
+		if (val)
+			rvals = g_list_append (rvals, val);
+
+	}
+	
+	g_list_foreach (rvals, recur_set, recur);
+	recur->rvals = rvals;
+	
+	if (rstr)
+		g_free (rstr);
+
+	return recur;
+}
+
+/* Recurrence For all Day
+ * Format: DTEND;VALUE=DATE:20070502
+ */
+gchar *
+recurrence_as_recur_string (GDataRecurrence *recur, gchar *zone_info, gboolean all_day)
+{
+	gchar *str = NULL, *loc = NULL, *val = NULL;
+
+	g_return_val_if_fail (recur != NULL, NULL);
+	g_return_val_if_fail (recur->startt != NULL, NULL);			
+	
+	if (!zone_info)
+		zone_info = "";	
+
+	/* retrieve the location */
+	 while (zone_info) 
+	{
+		val = strsep (&zone_info, "\n");
+		if (strstr (val, "X-LIC-LOCATION")) {
+			loc = strstr (val, ":");
+			loc++;
+		}
+	}
+
+	 if(!all_day) {	
+		 if (recur->startt) 
+			 str = g_strconcat("DTSTART;TZID=", 
+					 loc, ":", 
+					 recur->startt, 
+					 "\n", NULL);		
+
+		 if (recur->endt) 
+			 str = g_strconcat(str, "DTEND;TZID=", 
+					 loc, ":", 
+					 recur->endt, 
+					 "\n", NULL);	
+
+		 if (recur->rrule) 
+			 str = g_strconcat(str, "RRULE:", 
+					 recur->rrule, 
+					 "\n", NULL);
+	 } else {
+
+		 if (recur->startt) {	
+			 char *tok;
+			 tok = strtok (g_strdup(recur->startt), "T");
+			 str = g_strconcat ("DTSTART;VALUE=DATE:", 
+					 tok, "\n", NULL);
+			 g_free(tok);
+		 }
+
+		 if (recur->endt) {
+			 gchar *tok;	
+			 tok = strtok (g_strdup(recur->endt), "T");
+			 str = g_strconcat (str, "DTEND;VALUE=DATE:", tok, "\n", NULL);
+			 g_free (tok);
+		 }
+
+		 if (recur->rrule) 
+			 str = g_strconcat(str, "RRULE:", 
+					 recur->rrule, "\n", NULL);
+
+	 }
+	
+	/* for recurrence exceptions */
+	if (recur->exdate)
+		str = g_strconcat (str, "EXDATE:", 
+					recur->exdate, "\n", NULL);
+	
+	return str;
+}
+
+
 /**
  * gdata_entry_new:
  * Creates a new #GDataEntry.
@@ -565,6 +752,12 @@
 		}
 		else if (!xmlStrcmp (cur->name, (xmlChar *)"recurrence")) {
 			priv->is_recurrent = TRUE;
+			gchar *rstr = (gchar *)xmlNodeListGetString (doc, cur->xmlChildrenNode, 1);
+			priv->recur_string = g_strdup(rstr);
+#if 1
+			priv->recur = recur_string_to_recurrence (g_strdup(priv->recur_string));
+			/* free the value */
+#endif
 		}
 
 		else if (!xmlStrcmp (cur->name, (xmlChar *)"who")) {
@@ -621,9 +814,8 @@
 	cur = cur->xmlChildrenNode;
 	while (cur != NULL)
 	{
-		if (!xmlStrcmp (cur->name, (xmlChar *)"entry")) {
+		if (!xmlStrcmp (cur->name, (xmlChar *)"entry")) 
 			list = g_slist_prepend (list, gdata_entry_new_from_xmlptr (doc, cur));
-		}
 		cur = cur->next;
 	}
 
@@ -651,7 +843,7 @@
 
 	g_return_val_if_fail (entry_xml != NULL && *entry_xml != '\0', NULL);
 	doc = xmlReadMemory (entry_xml, strlen(entry_xml), "feed.xml", NULL, 0);
-
+	
 	if (doc == NULL)
 		return NULL;
 
@@ -688,7 +880,9 @@
 	xmlNsPtr ns;
 	xmlNodePtr cur, cur_child, root;
 	xmlDocPtr doc;
+	gchar *zone_info, *rstr;
 	gint xml_buffer_size;
+	gboolean all_day;
 
 	g_return_val_if_fail(entry !=NULL, NULL);
 	g_return_val_if_fail(GDATA_IS_ENTRY (entry), NULL);
@@ -763,7 +957,18 @@
 		cur_child = xmlNewChild(root, NULL, (xmlChar *)"title", (xmlChar *)priv->title);
 		xmlSetProp (cur_child, (xmlChar *)"type", (xmlChar *)"text");
 	}
+#if 1 
+	if (priv->recur) {
+		zone_info = gdata_entry_get_zone_info (entry);
+		all_day = gdata_entry_is_all_day(entry);
+		rstr = recurrence_as_recur_string (priv->recur, zone_info, all_day);
 
+		if (rstr) {
+			cur_child = xmlNewChild(root, NULL, (xmlChar *)"recurrence", (xmlChar *)rstr);
+			xmlSetNs (cur_child, xmlNewNs (cur_child, NULL, (xmlChar *)"gd"));
+		}
+	}
+#endif
 	/*
 	   if (priv->field_table) {
 	   g_hash_table_foreach (priv->field_table,(GHFunc) _build_hash_table_entries, &root);
@@ -772,7 +977,6 @@
 
 	xmlDocDumpMemory(doc, &xmlString, &xml_buffer_size);
 	priv->entry_xml = g_strdup((gchar *)xmlString);
-
 	xmlFree(xmlString);
 	xmlFreeDoc(doc);
 
@@ -1046,6 +1250,123 @@
 }
 
 /**
+ * gdata_entry_get_recur_start:
+ * @entry: A #GDataEntry object
+ * Retrieves recurrence start date
+ */
+
+gchar *
+gdata_entry_get_recur_start (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+	GDataRecurrence *recur;
+	
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur = priv->recur;
+	return recur->startt;
+}
+
+gchar *
+gdata_entry_get_recur_end (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+	GDataRecurrence *recur;
+	
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur = priv->recur;
+	return recur->endt;
+}
+
+gchar *
+gdata_entry_get_recur_rule (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+	GDataRecurrence *recur;
+	
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur = priv->recur;
+	return recur->rrule;
+}
+
+gchar *
+gdata_entry_get_recur_exdate (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;	
+	GDataRecurrence *recur;
+	
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);	
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur = priv->recur;
+
+	g_return_val_if_fail (recur->exdate != NULL, NULL);	
+	return recur->exdate;
+}
+
+GSList *
+gdata_entry_get_attendee_list (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	return priv->attendees;
+}
+
+gchar *
+gdata_entry_get_zone_info (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+	
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	return priv->zone_info;
+}
+
+GDataRecurrence *
+gdata_entry_get_recurrence (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+	g_return_val_if_fail (entry != NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE (entry);
+	return priv->recur;
+	
+}
+
+/**
+ * gdata_entry_set_all_day:
+ * @entry: A #GDataEntry object:
+ * returns true if all day event 
+ */
+gboolean
+gdata_entry_is_all_day (GDataEntry *entry)
+{
+	GDataEntryPrivate *priv;
+	
+	g_return_val_if_fail (entry != NULL, 0);
+	g_return_val_if_fail (GDATA_IS_ENTRY(entry), 0);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	return priv->is_all_day;
+}
+
+/**
  * gdata_entry_set_author:
  * @entry: A #GDataEntry object.
  * @author: A list of authors.
@@ -1083,9 +1404,6 @@
 	priv->entry_needs_update = TRUE;
 }
 
-
-
-
 /**
  * gdata_entry_set_categories:
  * @entry: A GDataEntry object.
@@ -1369,28 +1687,116 @@
 	return priv->is_recurrent;
 }
 
-GSList *
-gdata_entry_get_attendee_list (GDataEntry *entry)
+
+void
+gdata_entry_set_attendee_list (GDataEntry *entry, GSList *attendees)
 {
 	GDataEntryPrivate *priv;
 
-	g_return_val_if_fail (entry != NULL, NULL);
-	g_return_val_if_fail (GDATA_IS_ENTRY(entry), NULL);
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	g_return_if_fail (attendees != NULL);
 
 	priv = GDATA_ENTRY_GET_PRIVATE(entry);
-	return priv->attendees;
+	priv->attendees = attendees;
+	priv->has_attendees = TRUE;
 }
 
 void
-gdata_entry_set_attendee_list (GDataEntry *entry, GSList *attendees)
+gdata_entry_set_recur_rule (GDataEntry *entry, gchar *rrule)
 {
 	GDataEntryPrivate *priv;
+	GDataRecurrence *recur;
+	
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	g_return_if_fail (rrule != NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur = gdata_entry_get_recurrence (entry);
+	recur->rrule = rrule;
+}
 
+void
+gdata_entry_set_recur_end (GDataEntry *entry, gchar *endt)
+{
+	GDataEntryPrivate *priv;
+	GDataRecurrence *recur;
+	
 	g_return_if_fail (entry != NULL);
 	g_return_if_fail (GDATA_IS_ENTRY(entry));
-	g_return_if_fail (attendees != NULL);
+	g_return_if_fail (endt != NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur =  gdata_entry_get_recurrence(entry);	
+	recur->endt = endt;
+}
 
+void
+gdata_entry_set_recur_start (GDataEntry *entry, gchar *startt)
+{
+	GDataEntryPrivate *priv;
+	GDataRecurrence *recur;
+		
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	g_return_if_fail (startt != NULL);
+
 	priv = GDATA_ENTRY_GET_PRIVATE(entry);
-	priv->attendees = attendees;
-	priv->has_attendees = TRUE;
+	recur = gdata_entry_get_recurrence(entry);
+	recur->startt = startt;
 }
+
+void
+gdata_entry_set_recur_exdate (GDataEntry *entry, gchar *exdate)
+{
+	GDataEntryPrivate *priv;	
+	GDataRecurrence *recur;
+	
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	g_return_if_fail (exdate != NULL);
+
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	recur = gdata_entry_get_recurrence(entry);
+	recur->exdate = exdate;
+}
+
+void
+gdata_entry_set_recurrence (GDataEntry *entry, GDataRecurrence *recur)
+{
+	GDataEntryPrivate *priv;
+	
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	g_return_if_fail (recur != NULL);
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	priv->recur = recur;
+}
+
+void
+gdata_entry_set_zone_info (GDataEntry *entry, gchar *zone_info)
+{
+	GDataEntryPrivate *priv;
+	
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	g_return_if_fail (zone_info != NULL);	
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	priv->zone_info = g_strdup (zone_info);
+}
+
+void
+gdata_entry_set_all_day (GDataEntry *entry, gboolean is_all_day)
+{
+	GDataEntryPrivate *priv;
+	
+	g_return_if_fail (entry != NULL);
+	g_return_if_fail (GDATA_IS_ENTRY(entry));
+	
+	priv = GDATA_ENTRY_GET_PRIVATE(entry);
+	priv->is_all_day = is_all_day;
+}
+
Index: servers/google/libgdata/gdata-feed.c
===================================================================
--- servers/google/libgdata/gdata-feed.c	(revision 8620)
+++ servers/google/libgdata/gdata-feed.c	(working copy)
@@ -535,7 +535,7 @@
 
 	xmlChar *value;
 	gint value_size;
-
+	
 	g_return_val_if_fail(feedXML != NULL && *feedXML != '\0', NULL);
 	doc = xmlReadMemory(feedXML, length,
 			"feed.xml",
Index: servers/google/libgdata/gdata-entry.h
===================================================================
--- servers/google/libgdata/gdata-entry.h	(revision 8620)
+++ servers/google/libgdata/gdata-entry.h	(working copy)
@@ -27,8 +27,8 @@
 
 #include <glib.h>
 #include <glib-object.h>
+#include <glib/gprintf.h>
 
-
 /* LibXML2 includes */
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -76,6 +76,17 @@
 	gchar *attendee_type;
 };
 
+typedef struct _GDataRecurrence GDataRecurrence;
+struct _GDataRecurrence {
+	GList *rvals;
+	
+	/* TODO: rrule can occur one or more times */
+	gchar *rrule;	
+	gchar *startt;
+	gchar *endt;
+	gchar *exdate;
+};
+
 GType gdata_entry_get_type(void);
 
 
@@ -121,15 +132,28 @@
 
 gchar * gdata_entry_get_end_date (GDataEntry *entry);
 
-gchar *
-gdata_entry_get_visibility (GDataEntry *entry);
+gchar * gdata_entry_get_visibility (GDataEntry *entry);
 
-gchar *
-gdata_entry_get_transparency (GDataEntry *entry);
+gchar * gdata_entry_get_transparency (GDataEntry *entry);
 
-GSList *
-gdata_entry_get_attendee_list (GDataEntry *entry);
+GSList * gdata_entry_get_attendee_list (GDataEntry *entry);
 
+GDataRecurrence * gdata_entry_get_recurrence (GDataEntry *entry);
+
+gchar * gdata_entry_get_recur_start (GDataEntry *entry);
+
+gchar * gdata_entry_get_recur_end (GDataEntry *entry);
+
+gchar * gdata_entry_get_recur_rule (GDataEntry *entry);
+
+gchar * gdata_entry_get_recur_exdate (GDataEntry *entry);
+
+gchar * gdata_entry_get_zone_info (GDataEntry *entry);
+
+gboolean gdata_entry_is_all_day (GDataEntry *entry);
+
+GSList * gdata_entries_new_from_xml (const gchar *feedXML, const gint length);
+
 void gdata_entry_set_author (GDataEntry *entry, GSList *author);
 
 void gdata_entry_set_categories (GDataEntry *entry, GSList *categories);
@@ -158,15 +182,26 @@
 
 void gdata_entry_create_categories (GDataEntry *entry, const gchar *scheme, const gchar *label , const gchar *term);
 
-GSList * gdata_entries_new_from_xml (const gchar *feedXML, const gint length);
+void gdata_entry_set_id (GDataEntry *entry, gchar *id);
 
-void
-gdata_entry_set_id (GDataEntry *entry, gchar *id);
-
 gboolean gdata_entry_is_recurrent (GDataEntry *entry);
 
-void
-gdata_entry_set_attendee_list (GDataEntry *entry, GSList *attendee);
+void gdata_entry_set_attendee_list (GDataEntry *entry, GSList *attendee);
+
+void gdata_entry_set_recurrence (GDataEntry *entry, GDataRecurrence *recurrence);
+
+void gdata_entry_set_recur_end (GDataEntry *entry, gchar *endt);
+
+void gdata_entry_set_recur_start (GDataEntry *entry, gchar *startt);
+
+void gdata_entry_set_recur_rule (GDataEntry *entry, gchar *rrule);
+
+void gdata_entry_set_recur_exdate (GDataEntry *entry, gchar *exdate);
+
+void gdata_entry_set_zone_info (GDataEntry *entry, gchar *zoneinfo);
+
+void gdata_entry_set_all_day (GDataEntry *entry, gboolean all_day);
+
 #endif
 
 
Index: calendar/backends/google/e-cal-backend-google-utils.c
===================================================================
--- calendar/backends/google/e-cal-backend-google-utils.c	(revision 8615)
+++ calendar/backends/google/e-cal-backend-google-utils.c	(working copy)
@@ -402,13 +402,15 @@
 {
 	ECalComponent *comp;
 	ECalComponentText text;
-	ECalComponentDateTime dt;
+	ECalComponentDateTime dt, dt_end, *dt_ex;
 	ECalComponentOrganizer *org = NULL;
 	icaltimezone *default_zone;
+	GSList *go_attendee_list = NULL, *l = NULL, *attendee_list = NULL;
+	GSList *category_ids, rlist, *ex_list = NULL;
+	struct icalrecurrencetype recur_type;	
+	struct icaltimetype ictt, itt_utc, itt, ictt_z, ictt_end, ictt_end_z, ictt_ex;
 	const char *description, *uid, *temp;
-	struct icaltimetype itt_utc, itt;
-	GSList *category_ids;
-	GSList *go_attendee_list = NULL, *l = NULL, *attendee_list = NULL;
+	gchar *endt = NULL, *startt = NULL, *rrule = NULL, *ex_date = NULL;
 
 	comp = e_cal_component_new ();
 	default_zone = e_cal_backend_google_get_default_zone (cbgo);
@@ -498,9 +500,6 @@
 			go_attendee = (Attendee *)l->data;
 
 			attendee = g_new0 (ECalComponentAttendee, 1);
-#if 0
-			_print_attendee ((Attendee *)l->data);
-#endif
 			attendee->value = g_strconcat ("MAILTO:", go_attendee->attendee_email, NULL);
 			attendee->cn = g_strdup (go_attendee->attendee_value);
 			attendee->role = ICAL_ROLE_OPTPARTICIPANT;
@@ -564,16 +563,68 @@
 			dt.tzid = icaltimezone_get_tzid (default_zone);
 		}
 	}
-#if 0
-	/* temp hack to see how recurrence work */
-	ECalComponentRange *recur_id;
-	recur_id = g_new0 (ECalComponentRange, 1);
-	recur_id->datetime = dt;
-	recur_id->type = E_CAL_COMPONENT_RANGE_THISFUTURE;
-	e_cal_component_set_recurid (comp, recur_id);
-#endif
+
 	e_cal_component_set_dtend (comp, &dt);
 
+	/* Recurrence */
+	if (gdata_entry_is_recurrent(item->entry)) {
+		startt = gdata_entry_get_recur_start (item->entry);
+		endt = gdata_entry_get_recur_end (item->entry);
+
+		if (startt)
+			ictt = icaltime_from_string(g_strdup(startt));
+		if (endt)
+			ictt_end = icaltime_from_string (g_strdup(endt));
+
+		/* zone */	
+		ictt.zone = default_zone;
+		ictt_end.zone = default_zone;
+		ictt_z = ictt;
+
+		if (!icaltime_get_timezone(ictt))
+			icaltime_set_timezone (&ictt, default_zone);
+
+		if (default_zone) {
+			ictt_z = icaltime_convert_to_zone (ictt, default_zone);
+			icaltime_set_timezone (&ictt_z, default_zone);
+
+			ictt_end_z = icaltime_convert_to_zone (ictt_end, default_zone);
+			icaltime_set_timezone (&ictt_end_z, default_zone);
+		}
+
+		/* recur start time */
+		dt.value = &ictt_z;
+		dt.tzid = icaltimezone_get_tzid (default_zone);
+		e_cal_component_set_dtstart (comp, &dt);
+
+		/* recur end time */
+		dt_end.value = &ictt_end_z;
+		dt_end.tzid = icaltimezone_get_tzid (default_zone);
+		e_cal_component_set_dtend(comp, &dt_end);
+
+		/* rrule */	
+		rrule = gdata_entry_get_recur_rule (item->entry);
+		icalrecurrencetype_clear (&recur_type);
+		recur_type = icalrecurrencetype_from_string(rrule);
+		rlist.data = &recur_type;
+		rlist.next = NULL;
+		e_cal_component_set_rrule_list (comp, &rlist);
+
+		/* exdate */
+		ex_list = NULL;
+		ex_date = gdata_entry_get_recur_exdate (item->entry);
+	
+		if (ex_date) {
+			ictt_ex = icaltime_from_string(ex_date);
+			dt_ex = g_new0(ECalComponentDateTime, 1);	
+			dt_ex->value = &ictt_ex;
+			dt_ex->tzid = icaltimezone_get_tzid (default_zone);
+
+			ex_list = g_slist_append(ex_list, dt_ex);	
+			e_cal_component_set_exdate_list(comp, ex_list);
+		}	
+	}
+	
 	uid = gdata_entry_get_id (item->entry);
 	e_cal_component_set_uid (comp, (const char *)uid);
 	e_cal_component_commit_sequence (comp);
@@ -595,22 +646,27 @@
 {
 	ECalBackendGooglePrivate *priv;
 	EGoItem *item;
-	ECalComponentText text;
-	ECalComponentDateTime dt;
-	gchar *temp, *term = NULL;
+	GDataEntry *entry;
+	ECalComponentDateTime dt, *dt_exdate;
+	GSList *list = NULL, *rlist = NULL;
+	GSList *attendee_list = NULL, *alist = NULL;
 	icaltimezone *default_zone;
 	icaltimetype itt;
-	const char *uid;
-	const char *location;
-	GSList *list = NULL;
-	GDataEntry *entry;
-	ECalComponentText *t;
-	GSList *attendee_list = NULL, *l = NULL;
+	struct icalrecurrencetype *icalrecur;
+	ECalComponentText text, *t;
+	const char *uid, *location;
+	gchar *temp, *term = NULL;
+	gchar *time_ptr = NULL, *ex_dt = NULL, *zone_info = NULL, *rstring = NULL;
 
 	priv = cbgo->priv;
 
 	item = g_new0 (EGoItem, 1);
 	entry = gdata_entry_new ();
+	
+	/* Zone info */
+	zone_info  = e_cal_backend_google_get_zone_info (cbgo);
+	if (zone_info)
+		gdata_entry_set_zone_info (entry, zone_info);
 
 	/* Summary */
 	e_cal_component_get_summary (comp, &text);
@@ -653,20 +709,80 @@
 	if (e_cal_backend_get_kind (E_CAL_BACKEND(cbgo)) == ICAL_VEVENT_COMPONENT)
 		term = g_strconcat (GDATA_SCHEMA, "event", NULL);
 
-	gdata_entry_create_categories (entry, g_strconcat (GDATA_SCHEMA, "kind", NULL),
+	gdata_entry_create_categories (entry, 
+			g_strconcat (GDATA_SCHEMA, "kind", NULL),
 			"label",
 			term);
 	/* Attendee */
 	e_cal_component_get_attendee_list (comp, &attendee_list);
 
-	for (l = attendee_list; l!=NULL; l=l->next) {
+	for (alist = attendee_list; alist!=NULL; alist=alist->next) {
 		ECalComponentAttendee *ecal_att;
-		ecal_att = (ECalComponentAttendee *)l->data;
+		ecal_att = (ECalComponentAttendee *)alist->data;
 		/* TODO Convert ECalComponentAttendee to Attendee, and change during parsing to store the types */
 
 	}
 
 	/* FIXME For transparency and status */
+	
+	/* Checking for All day event */
+	if (dt.value->is_date) 
+		gdata_entry_set_all_day (entry, TRUE);
+	else
+		gdata_entry_set_all_day (entry, FALSE);
+
+
+	/* recurrence */ 
+	if (e_cal_component_has_recurrences(comp)) {
+		e_cal_component_get_rrule_list(comp, &rlist);
+		icalrecur = (struct icalrecurrencetype *)rlist->data;
+
+		/*TODO rrule as a list */
+		if (!icalrecur)
+			g_printf ("\n icalrecur fails at %s \n", G_STRLOC);
+		rstring = icalrecurrencetype_as_string(icalrecur);
+		
+		/* set the rrule */
+		icaltimetype ritt;
+		GDataRecurrence *recur = g_new0 (GDataRecurrence, 1);
+		recur->rrule = rstring;
+			
+		/* start time */
+		e_cal_component_get_dtstart (comp, &dt);
+		ritt = icaltime_convert_to_zone (*dt.value, default_zone);
+		dt.value = &ritt;
+		temp = get_date (dt);
+		recur->startt = gd_date_to_ical(temp);
+
+		/* end time*/
+		e_cal_component_get_dtend (comp, &dt);
+		ritt = icaltime_convert_to_zone (*dt.value, default_zone);
+		dt.value = &ritt;
+		temp = get_date (dt);
+		recur->endt = gd_date_to_ical(temp);
+
+		GSList *exdate_list=NULL, *ex_list=NULL;
+		e_cal_component_get_exrule_list(comp, &ex_list);
+		e_cal_component_get_exdate_list(comp, &exdate_list);
+
+		/* exdate */		
+		while (exdate_list) {
+			dt_exdate = (ECalComponentDateTime *)exdate_list->data;
+			if(recur->startt) {
+				time_ptr = strstr(recur->startt, "T");
+				time_ptr++;
+			}
+			
+			recur->exdate = gd_date_to_ical(get_date(*dt_exdate));
+			ex_dt = strstr(recur->exdate, "T");
+			ex_dt++;
+			if(time_ptr)
+				strcpy(ex_dt, time_ptr);
+			exdate_list = g_slist_next(exdate_list);
+		}
+
+		gdata_entry_set_recurrence (entry, recur);
+	}
 	item->entry = entry;
 	return item;
 }
@@ -843,9 +959,16 @@
 	hour = (itt.hour<10) ? g_strdup_printf("0%d", itt.hour):g_strdup_printf ("%d", itt.hour);
 	minute = (itt.minute<10) ? g_strdup_printf("0%d", itt.minute):g_strdup_printf ("%d", itt.minute);
 	second = (itt.second<10) ? g_strdup_printf ("0%d", itt.second):g_strdup_printf ("%d", itt.second);
+	
+	/* FIXME not the best way to do this */
+	/* Long day Event */
+	if (dt.value->is_date) 	
+		temp = g_strdup_printf ("%d-%s-%s", itt.year, month, day);
+	else 
+		temp =  g_strdup_printf ("%d-%s-%sT%s:%s:%s.000", 
+					 itt.year, month, day, 
+					 hour, minute, second);
 
-	/* FIXME not the best way to do this */
-	temp =  g_strdup_printf ("%d-%s-%sT%s:%s:%s.000", itt.year, month, day, hour, minute, second);
 	g_free (month);
 	g_free (day);
 	g_free (hour);
Index: calendar/backends/google/e-cal-backend-google.c
===================================================================
--- calendar/backends/google/e-cal-backend-google.c	(revision 8615)
+++ calendar/backends/google/e-cal-backend-google.c	(working copy)
@@ -79,6 +79,7 @@
 	gchar *uri;
 	gchar *feed;
 	gchar *local_attachments_store;	
+	gchar *zone_info;
 
 	gboolean read_only;
 	gboolean mode_changed;
@@ -401,7 +402,10 @@
 	g_return_val_if_fail(E_IS_CAL_BACKEND_GOOGLE(cbgo), GNOME_Evolution_Calendar_OtherError);
 	g_return_val_if_fail(tzobj != NULL, GNOME_Evolution_Calendar_OtherError);
 
-	priv = cbgo->priv;
+	priv = (ECalBackendGooglePrivate *)cbgo->priv;
+	/* Zone information as string */
+	e_cal_backend_google_set_zone_info (cbgo, g_strdup(tzobj));
+
 	tz_comp = icalparser_parse_string (tzobj);
 	if (!tz_comp)
 		return GNOME_Evolution_Calendar_InvalidObject;
@@ -1546,6 +1550,18 @@
 	priv->password = password;
 }
 
+void
+e_cal_backend_google_set_zone_info (ECalBackendGoogle *cbgo, gchar *zone_info)
+{
+	ECalBackendGooglePrivate *priv;
+	priv = cbgo->priv;
+	
+	g_return_if_fail (cbgo != NULL);
+	g_return_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo));
+		
+	priv->zone_info = zone_info;
+}
+
 /**
  * e_cal_backend_google_get_cache:
  * @cbgo a #ECalBackendGoogle object
@@ -1689,6 +1705,17 @@
 	return priv->password;
 }
 
+gchar *
+e_cal_backend_google_get_zone_info (ECalBackendGoogle *cbgo)
+{
+	ECalBackendGooglePrivate *priv;
+	
+	g_return_val_if_fail (cbgo != NULL, NULL);
+	g_return_val_if_fail (E_IS_CAL_BACKEND_GOOGLE(cbgo), NULL);
+	
+	priv = cbgo->priv;
+	return priv->zone_info;
+}
 
 gchar *
 e_cal_backend_google_get_local_attachments_store (ECalBackendGoogle *cbgo)
Index: calendar/backends/google/e-cal-backend-google.h
===================================================================
--- calendar/backends/google/e-cal-backend-google.h	(revision 8615)
+++ calendar/backends/google/e-cal-backend-google.h	(working copy)
@@ -74,6 +74,7 @@
 gchar * e_cal_backend_google_get_password (ECalBackendGoogle *cbgo);
 gchar * e_cal_backend_google_get_local_attachments_store (ECalBackendGoogle *cbgo);
 gint e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo);
+gchar * e_cal_backend_google_get_zone_info (ECalBackendGoogle *cbgo);
 
 void e_cal_backend_google_set_entry (ECalBackendGoogle *cbgo, GDataEntry *entry);
 void e_cal_backend_google_set_cache (ECalBackendGoogle *cbgo, ECalBackendCache *cache);
@@ -85,6 +86,7 @@
 void e_cal_backend_google_set_username (ECalBackendGoogle *cbgo, gchar *username);
 void e_cal_backend_google_set_password (ECalBackendGoogle *cbgo, gchar *password);
 void e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo,gint timeout_id);
+void e_cal_backend_google_set_zone_info (ECalBackendGoogle *cbgo, gchar *zone_info);
 
 G_END_DECLS
 #endif
