From c050cb45aa1eb2af7b53451334a4b979b27c5214 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Date: Sat, 4 Apr 1998 03:43:48 +0000 Subject: lots more -mig svn path=/trunk/; revision=105 --- calendar/cal-util/calobj.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'calendar/cal-util/calobj.c') 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; } -- cgit v1.2.3