From: Steve Brokenshire Date: Mon, 6 Jun 2016 21:59:15 +0000 (+0100) Subject: Added DUE property for saving data from a CalendarTaskObject. X-Git-Tag: release-0.02~155 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=2335b369fff55df21e55533d797d3ea455751ef6;p=xestiacalendar%2F.git Added DUE property for saving data from a CalendarTaskObject. Added the code and unit tests for the DUE property. --- diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index d311cd3..c4e6053 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -637,6 +637,46 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the DUE value. + + if (DueData.size() > 0){ + + DataLine += "DUE"; + + if (DueDataTimeZoneID.size() > 0){ + + DataLine += ";TZID="; + DataLine += DueDataTimeZoneID; + + } + + if (DueDataValue.size() > 0){ + + DataLine += ";VALUE="; + DataLine += DueDataValue; + + } + + if (SummaryDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += DueDataTokens; + + } + + DataLine += ":"; + DataLine += DueData; + 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 0b6eba2..b661b75 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -81,6 +81,7 @@ TEST(iCalendarSaveTask, SaveTaskTests){ " y of the todo.\n" "URL;EXTERNAL=YES:http://www.example.com/\n" "RRULE;TEST=DATA:FREQ=DAILY;COUNT=10\n" + "DUE;TZID=Europe/Truro;VALUE=DATE-TIME;TEST=YES:20160131T150000Z\n" "END:VTODO\n" "END:VCALENDAR";