aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/dialogs/recurrence-page.c31
2 files changed, 38 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 7956a56b78..2882432204 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,12 @@
2009-01-13 Milan Crha <mcrha@redhat.com>
+ ** Fix for bug #489437
+
+ * gui/dialogs/recurrence-page.c: (fill_component): Check whether
+ the 'until' date is in the future, and report error if not.
+
+2009-01-13 Milan Crha <mcrha@redhat.com>
+
** Fix for bug #567045
* gui/e-meeting-time-sel.c: (e_meeting_time_selector_construct),
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 8a93c4dfee..15171d52ed 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -903,6 +903,37 @@ fill_component (RecurrencePage *rpage, ECalComponent *comp)
e_cal_component_set_exdate_list (comp, list);
e_cal_component_free_exdate_list (list);
+ if (GTK_WIDGET_VISIBLE (priv->ending_menu) && GTK_WIDGET_IS_SENSITIVE (priv->ending_menu) &&
+ e_dialog_option_menu_get (priv->ending_menu, ending_types_map) == ENDING_UNTIL) {
+ /* check whether the "until" date is in the future */
+ struct icaltimetype tt;
+ gboolean ok = TRUE;
+
+ if (e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit), &tt.year, &tt.month, &tt.day)) {
+ ECalComponentDateTime dtstart;
+
+ /* the dtstart should be set already */
+ e_cal_component_get_dtstart (comp, &dtstart);
+
+ tt.is_date = 1;
+ tt.zone = NULL;
+
+ if (dtstart.value && icaltime_is_valid_time (*dtstart.value)) {
+ ok = icaltime_compare_date_only (*dtstart.value, tt) <= 0;
+
+ if (!ok)
+ e_date_edit_set_date (E_DATE_EDIT (priv->ending_date_edit), dtstart.value->year, dtstart.value->month, dtstart.value->day);
+ }
+
+ e_cal_component_free_datetime (&dtstart);
+ }
+
+ if (!ok) {
+ comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage), _("End time of the recurrence was before event's start"), priv->ending_date_edit);
+ return FALSE;
+ }
+ }
+
return TRUE;
}