aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-08-22 23:41:47 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-08-22 23:41:47 +0800
commit5902ae223d54526a59b5943cb493854ad57de666 (patch)
tree5a969b7b635d49f81aa08bfe80ae36b6bbc96182
parent8b36f00ff0585622b34b8352218302abb7626a3b (diff)
downloadgsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.tar
gsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.tar.gz
gsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.tar.bz2
gsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.tar.lz
gsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.tar.xz
gsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.tar.zst
gsoc2013-evolution-5902ae223d54526a59b5943cb493854ad57de666.zip
if the value given is a date, convert to a time in the current zone
2002-08-22 JP Rosevear <jpr@ximian.com> * 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
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/gui/calendar-model.c16
2 files changed, 17 insertions, 4 deletions
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 <jpr@ximian.com>
+
+ * 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 <jpr@ximian.com>
* 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);
}
}