summaryrefslogtreecommitdiffabout
path: root/korganizer/koeventviewer.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeventviewer.cpp18
1 files changed, 18 insertions, 0 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,6 +528,14 @@ void KOEventViewer::appendTodo(Todo *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 ));