From 2335b369fff55df21e55533d797d3ea455751ef6 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:59:15 +0100 Subject: [PATCH] Added DUE property for saving data from a CalendarTaskObject. Added the code and unit tests for the DUE property. --- .../calendartask/CalendarTask-Save.cpp | 40 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 1 + 2 files changed, 41 insertions(+) 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"; -- 2.39.5