From 4ec29933d911ca99f4d762747224c89bffce9c1b Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 30 Oct 2001 14:14:59 +0000 Subject: set to the default timezone for DATE values, in case the user switches to 2001-10-30 Damon Chaplin * gui/dialogs/task-page.c (task_page_fill_widgets): set to the default timezone for DATE values, in case the user switches to a DATE-TIME. svn path=/trunk/; revision=14461 --- calendar/gui/dialogs/task-page.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index c7243c9ede..17dec0d212 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -310,7 +310,8 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) CalClientGetStatus get_tz_status; GSList *l; const char *categories; - icaltimezone *zone; + icaltimezone *zone, *default_zone; + char *location; tpage = TASK_PAGE (page); priv = tpage->priv; @@ -333,6 +334,9 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } cal_component_free_text_list (l); + location = calendar_config_get_timezone (); + default_zone = icaltimezone_get_builtin_timezone (location); + /* Due Date. */ cal_component_get_due (comp, &d); zone = NULL; @@ -344,22 +348,19 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) if (due_tt->is_date) { e_date_edit_set_time_of_day (E_DATE_EDIT (priv->due_date), -1, -1); - + zone = default_zone; } else { e_date_edit_set_time_of_day (E_DATE_EDIT (priv->due_date), due_tt->hour, due_tt->minute); } } else { - char *location; - e_date_edit_set_time (E_DATE_EDIT (priv->due_date), -1); /* If no time is set, we use the default timezone, so the user usually doesn't have to set this when they set the date. */ - location = calendar_config_get_timezone (); - zone = icaltimezone_get_builtin_timezone (location); + zone = default_zone; } /* Note that if we are creating a new task, the timezones may not be @@ -392,21 +393,19 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) if (start_tt->is_date) { e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_date), -1, -1); + zone = default_zone; } else { e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_date), start_tt->hour, start_tt->minute); } } else { - char *location; - e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1); /* If no time is set, we use the default timezone, so the user usually doesn't have to set this when they set the date. */ - location = calendar_config_get_timezone (); - zone = icaltimezone_get_builtin_timezone (location); + zone = default_zone; } if (!zone) -- cgit v1.2.3