From 5902ae223d54526a59b5943cb493854ad57de666 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 22 Aug 2002 15:41:47 +0000 Subject: if the value given is a date, convert to a time in the current zone 2002-08-22 JP Rosevear * gui/calendar-model.c (set_completed): if the value given is a date, convert to a time in the current zone svn path=/trunk/; revision=17835 --- calendar/ChangeLog | 5 +++++ calendar/gui/calendar-model.c | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 268377b4ff..7471edd26d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,8 @@ +2002-08-22 JP Rosevear + + * gui/calendar-model.c (set_completed): if the value given is a + date, convert to a time in the current zone + 2002-08-20 JP Rosevear * gui/tasks-control.c (tasks_control_activate): don't set the diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index 976da12b96..cef066c1b1 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -990,6 +990,7 @@ set_classification (CalComponent *comp, static void set_completed (CalendarModel *model, CalComponent *comp, const void *value) { + CalendarModelPrivate *priv = model->priv; ECellDateEditValue *dv = (ECellDateEditValue*) value; if (!dv) { @@ -997,10 +998,17 @@ set_completed (CalendarModel *model, CalComponent *comp, const void *value) } else { time_t t; - /* We assume that COMPLETED is entered in the current timezone, - even though it gets stored in UTC. */ - t = icaltime_as_timet_with_zone (dv->tt, dv->zone); - + if (dv->tt.is_date) { + /* If its a date, it will be floating, + but completed needs a date time value */ + dv->tt.is_date = FALSE; + t = icaltime_as_timet_with_zone (dv->tt, priv->zone); + } else { + /* We assume that COMPLETED is entered in the current timezone, + even though it gets stored in UTC. */ + t = icaltime_as_timet_with_zone (dv->tt, dv->zone); + } + ensure_task_complete (comp, t); } } -- cgit v1.2.3