Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added RDATE property for saving data from a CalendarTimezoneObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 11 Jun 2016 21:41:38 +0000 (22:41 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 11 Jun 2016 21:41:38 +0000 (22:41 +0100)
Added the code and unit tests for the RDATE property in both
STANDARD and DAYLIGHT timezone types.

source/objects/calendartimezone/CalendarTimezone-Save.cpp
source/tests/xestiacalendar_icaltimezonesave.h

index 2dc194e..eaed644 100644 (file)
@@ -259,6 +259,51 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                }
                
                        }
+                       
+                       // Process the RDATE value.
+
+                       if (TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateData.size() > 0){
+               
+                               for (int CommentListSeek = 0; CommentListSeek < TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateData.size();
+                                       CommentListSeek++){
+       
+                                       DataLine += "RDATE";
+                       
+                                       if (TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateDataValue[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";VALUE=";
+                                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateDataValue[CommentListSeek];
+                       
+                                       }
+                               
+                                       if (TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateDataTimeZoneParam[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";TZID=";
+                                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateDataTimeZoneParam[CommentListSeek];
+                       
+                                       }
+                       
+                                       if (TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateDataTokens[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";";
+                                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateDataTokens[CommentListSeek];
+                       
+                                       }
+                               
+                                       DataLine += ":";
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].RecurranceDateData[CommentListSeek];
+                                       DataLine += "\n";
+
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                               
+                               }
+               
+                       }
                                
                        *SaveData += "END:STANDARD\n";
                                
@@ -432,7 +477,52 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                }
                
                        }
+                       
+                       // Process the RDATE value.
+
+                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateData.size() > 0){
+               
+                               for (int CommentListSeek = 0; CommentListSeek < TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateData.size();
+                                       CommentListSeek++){
+       
+                                       DataLine += "RDATE";
+                       
+                                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateDataValue[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";VALUE=";
+                                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateDataValue[CommentListSeek];
+                       
+                                       }
+                               
+                                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateDataTimeZoneParam[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";TZID=";
+                                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateDataTimeZoneParam[CommentListSeek];
+                       
+                                       }
+                       
+                                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateDataTokens[CommentListSeek].size() > 0){
+               
+                                               DataLine += ";";
+                                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateDataTokens[CommentListSeek];
+                       
+                                       }
+                               
+                                       DataLine += ":";
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceDateData[CommentListSeek];
+                                       DataLine += "\n";
+
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
                                
+                               }
+               
+                       }
+                       
                        *SaveData += "END:DAYLIGHT\n";
                                
                }
index abeb5b9..5698b44 100644 (file)
@@ -80,6 +80,8 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
        "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=kw;YO=YOYOS:Example timezone comment.\n"
+       "RDATE;VALUE=DATE;TZID=Europe/Truro;BEEP=BOOP:20160205,20160207,20160216,20160\n"
+       " 305\n"
        "END:STANDARD\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART:20160204T020000\n"
@@ -97,6 +99,8 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
        "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=kw;YO=YOYOS:Example timezone comment.\n"
+       "RDATE;VALUE=DATE;TZID=Europe/Truro;BEEP=BOOP:20160205,20160207,20160216,20160\n"
+       " 305\n"
        "END:DAYLIGHT\n"
        "END:VTIMEZONE\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