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

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

index 46c0be9..19920f7 100644 (file)
@@ -129,6 +129,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the TZOFFSETFROM value.
+       
+                       if (TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetFromData.size() > 0){
+               
+                               if (TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetFromTokens.size() > 0){
+               
+                                       DataLine += "TZOFFSETFROM;";
+                                       DataLine += TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetFromTokens;
+                       
+                               } else {
+
+                                       DataLine += "TZOFFSETFROM";
+                       
+                               }
+
+                               DataLine += ":";
+                               DataLine += TimezoneStandardCollection[TimezoneStandardSeek].TimeZoneOffsetFromData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+               
+                               DataLine.clear();
+                               DataLineProcessed.clear();
+               
+                       }
                                
                        *SaveData += "END:STANDARD\n";
                                
@@ -172,6 +200,34 @@ void CalendarTimezoneObject::SaveObjectData(string *SaveData){
                                DataLineProcessed.clear();
                
                        }
+                       
+                       // Process the TZOFFSETFROM value.
+       
+                       if (TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetFromData.size() > 0){
+               
+                               if (TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetFromTokens.size() > 0){
+               
+                                       DataLine += "TZOFFSETFROM;";
+                                       DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetFromTokens;
+                       
+                               } else {
+
+                                       DataLine += "TZOFFSETFROM";
+                       
+                               }
+
+                               DataLine += ":";
+                               DataLine += TimezoneDaylightCollection[TimezoneDaylightSeek].TimeZoneOffsetFromData;
+                               DataLine += "\n";
+               
+                               DataLineProcessed = OutputText(&DataLine);
+               
+                               *SaveData += DataLineProcessed;
+               
+                               DataLine.clear();
+                               DataLineProcessed.clear();
+               
+                       }
                                
                        *SaveData += "END:DAYLIGHT\n";
                                
index f2850a1..06283c1 100644 (file)
@@ -66,21 +66,27 @@ TEST(iCalendarSaveTimezone, SaveTimezoneTests){
        "TZURL;URL=YES:http://www.example.com/\n"
        "BEGIN:STANDARD\n"
        "DTSTART:20160204T020000\n"
+       "TZOFFSETFROM:-0500\n"
        "END:STANDARD\n"
        "BEGIN:STANDARD\n"
        "DTSTART;MEEP=MOO:20160205T020000\n"
+       "TZOFFSETFROM;LETS=GO:-0500\n"
        "END:STANDARD\n"
        "BEGIN:STANDARD\n"
        "DTSTART;MEEP=MOO:20160206T020000\n"
+       "TZOFFSETFROM;LETS=GO:-0500\n"
        "END:STANDARD\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART:20160204T020000\n"
+       "TZOFFSETFROM:-0500\n"
        "END:DAYLIGHT\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART;MEEP=MOO:20160205T020000\n"
+       "TZOFFSETFROM;LETS=GO:-0500\n"
        "END:DAYLIGHT\n"
        "BEGIN:DAYLIGHT\n"
        "DTSTART;MEEP=MOO:20160206T020000\n"
+       "TZOFFSETFROM;LETS=GO:-0500\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