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

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

index 19920f7..dd0bad5 100644 (file)
@@ -157,6 +157,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the TZOFFSETTO value.
+       
+                       if (TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetToData.size() > 0){
+               
+                               if (TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetToTokens.size() > 0){
+               
+                                       DataLine += "TZOFFSETTO;";
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetToTokens;
+                       
+                               } else {
+
+                                       DataLine += "TZOFFSETTO";
+                       
+                               }
+
+                               DataLine += ":";
+                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetToData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+               
+                               DataLine.clear();
+                               DataLineProcessed.clear();
+               
+                       }
                                
                        *SaveData += "END:STANDARD\n";
                                
@@ -228,6 +256,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the TZOFFSETTO value.
+       
+                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetToData.size() > 0){
+               
+                               if (TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetToTokens.size() > 0){
+               
+                                       DataLine += "TZOFFSETTO;";
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetToTokens;
+                       
+                               } else {
+
+                                       DataLine += "TZOFFSETTO";
+                       
+                               }
+
+                               DataLine += ":";
+                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetToData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+               
+                               DataLine.clear();
+                               DataLineProcessed.clear();
+               
+                       }
                                
                        *SaveData += "END:DAYLIGHT\n";
                                
index 06283c1..6110400 100644 (file)
@@ -67,26 +67,32 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "BEGIN:STANDARD\n"
        "DTSTART:20160204T020000\n"
        "TZOFFSETFROM:-0500\n"
+       "TZOFFSETTO:-0400\n"
        "END:STANDARD\n"
        "BEGIN:STANDARD\n"
        "DTSTART;MEEP=MOO:20160205T020000\n"
        "TZOFFSETFROM;LETS=GO:-0500\n"
+       "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "END:STANDARD\n"
        "BEGIN:STANDARD\n"
        "DTSTART;MEEP=MOO:20160206T020000\n"
        "TZOFFSETFROM;LETS=GO:-0500\n"
+       "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "END:STANDARD\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART:20160204T020000\n"
        "TZOFFSETFROM:-0500\n"
+       "TZOFFSETTO:-0400\n"
        "END:DAYLIGHT\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART;MEEP=MOO:20160205T020000\n"
        "TZOFFSETFROM;LETS=GO:-0500\n"
+       "TZOFFSETTO;EXAMPLE=DATA:-0400\n"
        "END:DAYLIGHT\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART;MEEP=MOO:20160206T020000\n"
        "TZOFFSETFROM;LETS=GO:-0500\n"
+       "TZOFFSETTO;EXAMPLE=DATA:-0400\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