Version: 0.1 (using KDE 3.1.94 (CVS >= 20031206), Mandrake Linux Cooker i586 - Cooker) Compiler: gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-3mdk) OS: Linux (i686) release 2.6.0-1mdkenterprise My wife was born 29/02/64 a leap year. Kontact summary seems to have a hard time figuring out that this year is also a leap year. I have attached a screen shot to explain. Kontact is calculating her next birthday when she will be 41 - ignoring this current year of 2004 - it's also an interesting point of how Kontact will handle leap year birthdays as the only occur every 4 years, but leap year baby's have to celebrate their non leap years either on the 28th of Feb or the 1st of March. Michael
Created attachment 4193 [details] screenshot
Subject: kdepim/kontact/plugins/kaddressbook CVS commit by tokoe: Calculate the correct date for birthdays on XXXX-02-29 in leap years. That fixes #72756. CCMAIL:72756-done@bugs.kde.org M +12 -2 kabsummarywidget.cpp 1.29 --- kdepim/kontact/plugins/kaddressbook/kabsummarywidget.cpp #1.28:1.29 @@ -260,7 +260,17 @@ bool KABSummaryWidget::eventFilter( QObj void KABSummaryWidget::dateDiff( const QDate &date, int &days, int &years ) { - QDate currentDate( 0, QDate::currentDate().month(), QDate::currentDate().day() ); + QDate currentDate; + QDate eventDate; - QDate eventDate( 0, date.month(), date.day() ); + if ( QDate::leapYear( date.year() ) && date.month() == 2 && date.day() == 29 ) { + currentDate = QDate( date.year(), QDate::currentDate().month(), QDate::currentDate().day() ); + if ( !QDate::leapYear( QDate::currentDate().year() ) ) + eventDate = QDate( date.year(), date.month(), 28 ); // celebrate one day earlier ;) + else + eventDate = QDate( date.year(), date.month(), date.day() ); + } else { + currentDate = QDate( 0, QDate::currentDate().month(), QDate::currentDate().day() ); + eventDate = QDate( 0, date.month(), date.day() ); + } int offset = currentDate.daysTo( eventDate );