summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/kincidenceformatter.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 4dfe16a..733b897 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -132,12 +132,20 @@ void KIncidenceFormatter::setEvent(Event *event)
}
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() );
addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate ));
//addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
//addTag("p",s);
}
@@ -241,12 +249,20 @@ void KIncidenceFormatter::setTodo(Todo *event )
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
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() );
addTag("p",i18n("<b>Alarm on: ") + s +" </b>");
addTag("p", KGlobal::locale()->formatDateTime( t, shortDate ));
//addTag("p",s);
}