Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added DTEND property for saving data from a CalendarFreeBusyObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 17:16:36 +0000 (18:16 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 17:16:36 +0000 (18:16 +0100)
Added the code and unit tests for the DTEND property.

source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp
source/tests/xestiacalendar_icalfreebusysave.h

index 1fabb01..ecf68e8 100644 (file)
@@ -150,6 +150,45 @@ void CalendarFreeBusyObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the DTEND.
+       
+       if (DateTimeEndData.size() > 0){
+               
+               DataLine += "DTEND";
+               
+               if (DateTimeEndDataValue.size() > 0){
+               
+                       DataLine += ";VALUE=";
+                       DataLine += DateTimeEndDataValue;                       
+                       
+               }
+               
+               if (DateTimeEndDataTimeZoneID.size() > 0){
+               
+                       DataLine += ";TZID=";
+                       DataLine += DateTimeEndDataTimeZoneID;                  
+                       
+               }
+               
+               if (DateTimeEndDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += DateTimeEndDataTokens;
+                       
+               }
+
+               DataLine += ":";
+               DataLine += DateTimeEndData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+               
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
        *SaveData += "END:VFREEBUSY\n";
        
 }
\ No newline at end of file
index bc09da4..fdd5d97 100644 (file)
@@ -61,6 +61,8 @@ TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
        "CONTACT;ALTREP=\"null:nodata\";LANGUAGE=en-GB;EXAMPLE=TOKEN:Contact Person\n"
        "DTSTART;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMONE=YES;PARAMTWO=NO:20160131T1\n"
        " 03000Z\n"
+       "DTEND;VALUE=DATE-TIME;TZID=Europe/Truro;PARAMFOUR=YES;PARAMTHREE=NO:20160131T\n"
+       " 183000Z\n"
        "END:VFREEBUSY\n"
        "END:VCALENDAR";        
 
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy