summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 607e549..92d2a80 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -396,6 +396,16 @@ void KOEventViewer::appendEvent(Event *event, int mode )
if (event->isAlarmEnabled()) {
Alarm *alarm =event->alarms().first() ;
QDateTime t = alarm->time();
+
+ if (event->doesRecur()) {
+ bool ok = false;
+ int offset = 0;
+ QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
+ if ( ok ) {
+ t = next;
+ }
+ }
+
QString s =i18n("( %1 before )").arg( alarm->offsetText() );
if(wideScreen ){
addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
@@ -518,7 +528,15 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
if (event->isAlarmEnabled()) {
Alarm *alarm =event->alarms().first() ;
QDateTime t = alarm->time();
- QString s =i18n("( %1 before )").arg( alarm->offsetText() );
+ if (event->doesRecur()) {
+ bool ok = false;
+ int offset = 0;
+ QDateTime next = event->getNextAlarmDateTime(& ok, &offset, QDateTime::currentDateTime() ) ;
+ if ( ok ) {
+ t = next;
+ }
+ }
+ QString s =i18n("( %1 before )").arg( alarm->offsetText() );
if ( wideScreen ) {
addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate ));
} else {