aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 9ad6fc0612..6f4597ab1f 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -3732,6 +3732,7 @@ e_contact_editor_is_valid (EABEditor *editor)
gboolean validation_error = FALSE;
GSList *iter;
GString *errmsg = g_string_new (_("The contact data is invalid:\n\n"));
+ time_t bday, now = time (NULL);
widget = e_builder_get_widget (ce->builder, "dateedit-birthday");
if (!(e_date_edit_date_is_valid (E_DATE_EDIT (widget)))) {
@@ -3740,6 +3741,13 @@ e_contact_editor_is_valid (EABEditor *editor)
e_contact_pretty_name (E_CONTACT_BIRTH_DATE));
validation_error = TRUE;
}
+ /* If valid, see if the birthday is a future date */
+ bday = e_date_edit_get_time (E_DATE_EDIT (widget));
+ if (bday > now) {
+ g_string_append_printf (errmsg, _("'%s' cannot be a future date"),
+ e_contact_pretty_name (E_CONTACT_BIRTH_DATE));
+ validation_error = TRUE;
+ }
widget = e_builder_get_widget (ce->builder, "dateedit-anniversary");
if (!(e_date_edit_date_is_valid (E_DATE_EDIT (widget)))) {