From: Steve Brokenshire Date: Mon, 6 Jun 2016 20:33:13 +0000 (+0100) Subject: Added DTSTAMP property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~173 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=11254a6e54e65166fcb20cad036bc9613de5e899;p=xestiacalendar%2F.git Added DTSTAMP property for saving data from a CalendarTaskObject. Added the code and unit tests for the DTSTAMP property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 740beb7..89da0ac 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -37,6 +37,34 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the DTSTAMP. + + if (DateTimeStampData.size() > 0){ + + if (DateTimeStampTokens.size() > 0){ + + DataLine += "DTSTAMP;"; + DataLine += DateTimeStampTokens; + + } else { + + DataLine += "DTSTAMP"; + + } + + DataLine += ":"; + DataLine += DateTimeStampData; + 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 16b9f89..7906a17 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -36,6 +36,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "PRODID:-//Xestia//Calendar Unit Testing//KW\n" "BEGIN:VTODO\n" "UID:00\n" + "DTSTAMP:20160131T160000Z\n" "END:VTODO\n" "END:VCALENDAR";