aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/calobj.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index 004ba7636d..6dd7fa98db 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -250,8 +250,17 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
return ical;
}
-void
-ical_object_save (iCalObject *ical)
+static char *
+to_str (int num)
+{
+ static char buf [40];
+
+ sprintf (buf, "%d", num);
+ return buf;
+}
+
+VObject *
+ical_object_to_vobject (iCalObject *ical)
{
VObject *o;
@@ -259,5 +268,27 @@ ical_object_save (iCalObject *ical)
o = newVObject (VCEventProp);
else
o = newVObject (VCTodoProp);
+
+ /* uid */
+ if (ical->uid)
+ addPropValue (o, VCUniqueStringProp, ical->uid);
+
+ /* seq */
+ addPropValue (o, VCSequenceProp, to_str (ical->seq));
+
+ /* dtstart */
+ addPropValue (o, VCDTstartProp, isodate_from_time_t (ical->dtstart));
+
+ /* dtend */
+ addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+
+ /* dcreated */
+ addPropValue (o, VCDTendProp, isodate_from_time_t (ical->created));
+
+ /* completed */
+ if (ical->completed)
+ addPropValue (o, VCDTendProp, isodate_from_time_t (ical->completed));
+
+ return o;
}