From df4595a2b8e0f837dfbe1b1123aa80990db9b992 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 4 Mar 2003 19:59:21 +0000 Subject: Partially Fixes #23606 (from Jack Jia ) 2003-03-04 JP Rosevear Partially Fixes #23606 (from Jack Jia ) * gui/dialogs/schedule-page.c (update_time): handle no end date if the start is date only * gui/dialogs/event-page.c (update_time): ditto svn path=/trunk/; revision=20146 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/dialogs/event-page.c | 8 +++++++- calendar/gui/dialogs/schedule-page.c | 7 ++++++- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index bd3be952b0..14d8dd5027 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2003-03-04 JP Rosevear + + Partially Fixes #23606 (from Jack Jia ) + + * gui/dialogs/schedule-page.c (update_time): handle no end date if + the start is date only + + * gui/dialogs/event-page.c (update_time): ditto + 2003-03-04 JP Rosevear Merging in 1.2 stuff diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index a7e1655c5a..384a39c419 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -286,7 +286,7 @@ static void update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDateTime *end_date) { EventPagePrivate *priv; - struct icaltimetype *start_tt, *end_tt; + struct icaltimetype *start_tt, *end_tt, implied_tt; icaltimezone *start_zone = NULL, *end_zone = NULL; CalClientGetStatus status; gboolean all_day_event; @@ -323,6 +323,12 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat all_day_event = FALSE; start_tt = start_date->value; end_tt = end_date->value; + if (!end_tt && start_tt->is_date) { + end_tt = &implied_tt; + *end_tt = *start_tt; + icaltime_adjust (end_tt, 1, 0, 0, 0); + } + if (start_tt->is_date && end_tt->is_date) { all_day_event = TRUE; if (icaltime_compare_date_only (*end_tt, *start_tt) > 0) { diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index b062088bc8..97029704a2 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -236,7 +236,12 @@ update_time (SchedulePage *spage, CalComponentDateTime *start_date, CalComponent } start_tt = *start_date->value; - end_tt = *end_date->value; + if (!end_date->value && start_tt.is_date) { + end_tt = start_tt; + icaltime_adjust (&end_tt, 1, 0, 0, 0); + } else { + end_tt = *end_date->value; + } /* If the end zone is not the same as the start zone, we convert it. */ priv->zone = start_zone; -- cgit v1.2.3