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

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

index dd0bad5..127ac00 100644 (file)
@@ -185,6 +185,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the RRULE value.
+       
+                       if (TimezoneStandardCollection[TimezoneStandardSeek].RecurranceRuleData.size() > 0){
+               
+                               if (TimezoneStandardCollection[TimezoneStandardSeek].RecurranceRuleDataTokens.size() > 0){
+               
+                                       DataLine += "RRULE;";
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].RecurranceRuleDataTokens;
+                       
+                               } else {
+
+                                       DataLine += "RRULE";
+                       
+                               }
+
+                               DataLine += ":";
+                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].RecurranceRuleData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+               
+                               DataLine.clear();
+                               DataLineProcessed.clear();
+               
+                       }
                                
                        *SaveData += "END:STANDARD\n";
                                
@@ -284,6 +312,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the RRULE value.
+       
+                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceRuleData.size() > 0){
+               
+                               if (TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceRuleDataTokens.size() > 0){
+               
+                                       DataLine += "RRULE;";
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceRuleDataTokens;
+                       
+                               } else {
+
+                                       DataLine += "RRULE";
+                       
+                               }
+
+                               DataLine += ":";
+                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].RecurranceRuleData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+               
+                               DataLine.clear();
+                               DataLineProcessed.clear();
+               
+                       }
                                
                        *SaveData += "END:DAYLIGHT\n";
                                
index 6110400..cf2266d 100644 (file)
@@ -78,6 +78,7 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "DTSTART;MEEP=MOO:20160206T020000\n"
        "TZOFFSETFROM;LETS=GO:-0500\n"
        "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
+       "RRULE;YAK=YES:FREQ=DAILY;COUNT=10\n"
        "END:STANDARD\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART:20160204T020000\n"
@@ -93,6 +94,7 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "DTSTART;MEEP=MOO:20160206T020000\n"
        "TZOFFSETFROM;LETS=GO:-0500\n"
        "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
+       "RRULE;YAK=YES:FREQ=DAILY;COUNT=10\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