[evolution-couchdb] Don't try to convert empty dates, since Evolution will think they are 01/01/1000



commit 96ee7f32a4008cf8d1547c204a36a49c34751b72
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Mon Nov 2 16:15:50 2009 +0100

    Don't try to convert empty dates, since Evolution will think they are 01/01/1000

 addressbook/e-book-backend-couchdb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/addressbook/e-book-backend-couchdb.c b/addressbook/e-book-backend-couchdb.c
index 9bf32eb..06fabc9 100644
--- a/addressbook/e-book-backend-couchdb.c
+++ b/addressbook/e-book-backend-couchdb.c
@@ -20,6 +20,7 @@
  * Authors: Rodrigo Moya <rodrigo moya canonical com>
  */
 
+#include <string.h>
 #include "e-book-backend-couchdb.h"
 #include <libedata-book/e-data-book.h>
 #include <libedata-book/e-data-book-view.h>
@@ -362,7 +363,7 @@ vcard_from_couch_document (CouchDBDocument *document)
 
 	/* birth date */
 	str = (char *) couchdb_document_contact_get_birth_date (document);
-	if (str) {
+	if (str && strlen (str) > 0) {
 		EContactDate *dt;
 
 		dt = e_contact_date_from_string (str);
@@ -374,7 +375,7 @@ vcard_from_couch_document (CouchDBDocument *document)
 
 	/* wedding date */
 	str = (char *) couchdb_document_contact_get_wedding_date (document);
-	if (str) {
+	if (str && strlen (str)) {
 		EContactDate *dt;
 
 		dt = e_contact_date_from_string (str);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]