summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index a2c20a8..5bc8c00 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1347,5 +1347,14 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
"-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
- startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
+ if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) {
+ bool ok;
+ QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
+ if ( ok ) {
+ int years = noc.date().year() - incidence->dtStart().date().year();
+ startString += i18n(" (%1 y.)"). arg( years );
+ }
+ }
+ else
+ startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
}