Index: addressbook/gui/contact-editor/e-contact-editor.c
===================================================================
--- addressbook/gui/contact-editor/e-contact-editor.c	(revision 33715)
+++ addressbook/gui/contact-editor/e-contact-editor.c	(working copy)
@@ -3750,6 +3750,7 @@
 					   TRUE);
 	e_date_edit_set_show_time (E_DATE_EDIT (widget), FALSE);
 	e_date_edit_set_time (E_DATE_EDIT (widget), -1);
+	e_date_edit_set_twodigit_year_can_future (E_DATE_EDIT (widget), FALSE);
 
 	a11y = gtk_widget_get_accessible (e_date_edit_get_entry (E_DATE_EDIT(widget)));
 	if (a11y != NULL) {
Index: addressbook/ChangeLog
===================================================================
--- addressbook/ChangeLog	(revision 33715)
+++ addressbook/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-06-21  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #339813
+
+	* gui/contact-editor/e-contact-editor.c: (e_contact_editor_create_date):
+	Setting new option 'e_date_edit_set_twodigit_year_can_future' to FALSE.
+
 2007-06-20  Laszlo (Laca) Peter  <laca@sun.com>
 
 	** Fix for bug #433732
Index: widgets/misc/e-dateedit.c
===================================================================
--- widgets/misc/e-dateedit.c	(revision 33715)
+++ widgets/misc/e-dateedit.c	(working copy)
@@ -64,8 +64,6 @@
 #include <e-util/e-util.h>
 #include "e-calendar.h"
 
-
-
 struct _EDateEditPrivate {
 	GtkWidget *date_entry;
 	GtkWidget *date_button;
@@ -127,6 +125,8 @@
 	EDateEditGetTimeCallback time_callback;
 	gpointer time_callback_data;
 	GtkDestroyNotify time_callback_destroy;
+
+	gboolean twodigit_year_can_future;
 };
 
 enum {
@@ -295,6 +295,8 @@
 	priv->time_callback_data = NULL;
 	priv->time_callback_destroy = NULL;
 
+	priv->twodigit_year_can_future = TRUE;
+
 	create_children (dedit);
 
 	/* Set it to the current time. */
@@ -1463,9 +1465,21 @@
 			const gchar *date_text,
 			struct tm *date_tm)
 {
-	if (e_time_parse_date (date_text, date_tm) != E_TIME_PARSE_OK)
+	gboolean twodigit_year = FALSE;
+
+	if (e_time_parse_date_ex (date_text, date_tm, &twodigit_year) != E_TIME_PARSE_OK)
 		return FALSE;
 
+	if (twodigit_year && !dedit->priv->twodigit_year_can_future) {
+		time_t t = time (NULL);
+		struct tm *today_tm = localtime (&t);
+
+		/* it was only 2 digit year in dedit and it was interpreted as in the future,
+		   but we don't want it as this, so decrease by 100 years to last century */
+		if (date_tm->tm_year > today_tm->tm_year)
+			date_tm->tm_year -= 100;
+	}
+	
 	return TRUE;
 }
 
@@ -1635,6 +1649,9 @@
 		e_date_edit_set_date (dedit,tmp_tm.tm_year,tmp_tm.tm_mon,tmp_tm.tm_mday);
 		gtk_widget_grab_focus (GTK_WIDGET (entry));		
 		return FALSE;
+	} else {
+		e_date_edit_get_date (dedit,&tmp_tm.tm_year,&tmp_tm.tm_mon,&tmp_tm.tm_mday);
+		e_date_edit_set_date (dedit,tmp_tm.tm_year,tmp_tm.tm_mon,tmp_tm.tm_mday);
 	}
 	return FALSE;
 }
@@ -1717,14 +1734,17 @@
 	if (priv->date_set_to_none || !priv->date_is_valid) {
 		gtk_entry_set_text (GTK_ENTRY (priv->date_entry), _("None"));
 	} else {
+		/* This is a strftime() format for a short date. 
+		   %x the preferred date representation for the current locale without the time,
+		   but has forced to use 4 digit year */
+		char *format = e_time_get_d_fmt_with_4digit_year ();
 		tmp_tm.tm_year = priv->year;
 		tmp_tm.tm_mon = priv->month;
 		tmp_tm.tm_mday = priv->day;
 		tmp_tm.tm_isdst = -1;
 
-		/* This is a strftime() format for a short date. 
-		   %x the preferred date representation for the current locale without the time*/
-		e_utf8_strftime (buffer, sizeof (buffer), "%x", &tmp_tm);
+		e_utf8_strftime (buffer, sizeof (buffer), format, &tmp_tm);
+		g_free (format);
 		gtk_entry_set_text (GTK_ENTRY (priv->date_entry), buffer);
 	}
 
@@ -2044,7 +2064,21 @@
 	return time_changed;
 }
 
+gboolean   e_date_edit_get_twodigit_year_can_future (EDateEdit  *dedit)
+{
+	g_return_val_if_fail (dedit != NULL, FALSE);
 
+	return dedit->priv->twodigit_year_can_future;
+}
+
+void       e_date_edit_set_twodigit_year_can_future (EDateEdit  *dedit,
+						     gboolean    value)
+{
+	g_return_if_fail (dedit != NULL);
+
+	dedit->priv->twodigit_year_can_future = value;
+}
+
 /* Sets a callback to use to get the current time. This is useful if the
    application needs to use its own timezone data rather than rely on the
    Unix timezone. */
@@ -2077,4 +2111,3 @@
 
 	return GTK_WIDGET(priv->date_entry);
 }
-
Index: widgets/misc/e-dateedit.h
===================================================================
--- widgets/misc/e-dateedit.h	(revision 33715)
+++ widgets/misc/e-dateedit.h	(working copy)
@@ -166,6 +166,10 @@
 void	   e_date_edit_set_make_time_insensitive(EDateEdit	*dedit,
 						 gboolean	 make_insensitive);
 
+/* Whether two-digit years in date could be modified as in future; default is TRUE */
+gboolean   e_date_edit_get_twodigit_year_can_future (EDateEdit  *dedit);
+void       e_date_edit_set_twodigit_year_can_future (EDateEdit  *dedit,
+						     gboolean    value);
 
 /* Sets a callback to use to get the current time. This is useful if the
    application needs to use its own timezone data rather than rely on the
Index: widgets/misc/ChangeLog
===================================================================
--- widgets/misc/ChangeLog	(revision 33715)
+++ widgets/misc/ChangeLog	(working copy)
@@ -1,3 +1,20 @@
+2007-06-21  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #339813
+
+	* e-dateedit.h: (e_date_edit_get_twodigit_year_can_future),
+	(e_date_edit_set_twodigit_year_can_future):
+	Added new option for component.
+	* e-dateedit.c: (e_date_edit_get_twodigit_year_can_future),
+	(e_date_edit_set_twodigit_year_can_future),
+	(struct _EDateEditPrivate::twodigit_year_can_future),
+	(e_date_edit_init), (e_date_edit_parse_date):
+	Implementing new option for component.
+	* e-dateedit.c: (on_date_entry_focus_out):
+	Always repaint value on focus out.
+	* e-dateedit.c: (e_date_edit_update_date_entry):
+	Forced to always show 4-digit year.
+
 2007-06-18  Srinivasa Ragavan  <sragavan@novell.com>
 	
         ** Fix for bug #448223 from Gilles Dartiguelongue
