From: Steve Brokenshire Date: Mon, 6 Jun 2016 20:54:28 +0000 (+0100) Subject: Added DTSTART property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~168 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=b2f94ae01141acdd0714895440f3b33a45f1a8fd;p=xestiacalendar%2F.git Added DTSTART property for saving data from a CalendarTaskObject. Added the code and unit tests for the DTSTART property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 7a1fbba..63838e4 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -191,6 +191,46 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the DTSTART. + + if (DateTimeStartData.size() > 0){ + + DataLine += "DTSTART"; + + if (DateTimeStartDataValue.size() > 0){ + + DataLine += ";VALUE="; + DataLine += DateTimeStartDataValue; + + } + + if (DateTimeStartDataTimeZoneID.size() > 0){ + + DataLine += ";TZID="; + DataLine += DateTimeStartDataTimeZoneID; + + } + + if (DateTimeStartDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += DateTimeStartDataTokens; + + } + + DataLine += ":"; + DataLine += DateTimeStartData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VTODO\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index 9a39ea3..48cbe12 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -63,6 +63,8 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "CREATED;CARAMEL=PLEASE:20160131T080000Z\n" "DESCRIPTION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXAMPLE=TOKEN;MOREDATA=YES:This \n" " is a description of the todo.\n" + "DTSTART;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMONE=YES;PARAMTWO=NO:20160131T1\n" + " 03000Z\n" "END:VTODO\n" "END:VCALENDAR";