[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] Pb with TimeZone and Exchange 2000
From:       Marc TAIEB <TAIEBMA () e-i ! com>
Date:       2004-06-02 16:53:31
Message-ID: 200406021853.31800.taiebma () e-i ! com
[Download RAW message or body]



Hello,

I'm using Exchange 2000 Server and the management of timezone doesn't work.

Here is an exemple of what Exchange 2000 return for the timezone :
BEGIN:VTIMEZONE^M
TZID:Sarajevo\, Skopje\, Sofija\, Vilnius\, Warsaw\, Zagreb^M
X-MICROSOFT-CDO-TZID:2^M
BEGIN:STANDARD^M
DTSTART:16010101T030000^M
TZOFFSETFROM:+0200^M
TZOFFSETTO:+0100^M
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU^M
END:STANDARD^M
BEGIN:DAYLIGHT^M
DTSTART:16010101T020000^M
TZOFFSETFROM:+0100^M
TZOFFSETTO:+0200^M
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=-1SU^M
END:DAYLIGHT^M
END:VTIMEZONE^M


I have made some modifications and now it's ok.

Here is the patch :

Index: libkcal/icalformatimpl.cpp
===================================================================
RCS file: /home/taiebma/kde/cvsroot/kdepim/libkcal/icalformatimpl.cpp,v
retrieving revision 1.102
diff -U2 -r1.102 icalformatimpl.cpp
--- libkcal/icalformatimpl.cpp  18 May 2004 08:36:22 -0000      1.102
+++ libkcal/icalformatimpl.cpp  2 Jun 2004 16:50:40 -0000
@@ -132,5 +132,10 @@
     QDateTime nearestStart(const QDateTime &t) const
     {
-      QDateTime tmp(QDate(dtstart.year,dtstart.month,dtstart.day), 
QTime(dtstart.hour,dtstart.minute,dtstart.second));
+      QDateTime tmp;
+      if (dtstart.year <= 1752)                //  Valid Date with Qt cannot 
be less than 1752
+         tmp.setDate(QDate(1753,dtstart.month,dtstart.day));
+      else
+         tmp.setDate(QDate(dtstart.year,dtstart.month,dtstart.day));
+      tmp.setTime( QTime(dtstart.hour,dtstart.minute,dtstart.second));
       // If this phase was not valid at the given time, give up.
       if (tmp > t) {
@@ -142,6 +147,6 @@
       // start times which are not aligned with a reference time, but a 
little
       // magic is sufficient to work around that...
-      QDateTime previous = mRrule->getPreviousDateTime(tmp);
-      if (mRrule->getNextDateTime(previous) < tmp)
+      QDateTime previous = mRrule->getPreviousDateTime(t);
+      if (mRrule->getNextDateTime(previous) < t)
         previous = mRrule->getNextDateTime(previous);
       return previous;

Regards.


-- 
Marc TAIEB
Euro Information Developpement 
Filiale du Credit Mutuel/CIC
Email : taiebma@e-i.com
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic