-rw-r--r-- | korganizer/koeventviewer.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index de11c13..39921a0 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -303,20 +303,23 @@ void KOEventViewer::appendEvent(Event *event, int mode ) | |||
303 | 303 | ||
304 | QString recurText = event->recurrence()->recurrenceText(); | 304 | QString recurText = event->recurrence()->recurrenceText(); |
305 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 305 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
306 | bool last; | 306 | bool ok; |
307 | QDate start = QDate::currentDate(); | 307 | QDate start = QDate::currentDate(); |
308 | QDate next; | 308 | QDateTime next; |
309 | next = event->recurrence()->getPreviousDate( start , &last ); | 309 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
310 | if ( !last ) { | 310 | if ( ok ) { |
311 | next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); | ||
312 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 311 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
313 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | 312 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
314 | QDateTime nextdt = QDateTime( next, event->dtStart().time()); | 313 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
315 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); | ||
316 | 314 | ||
317 | } else { | 315 | } else { |
318 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 316 | bool last; |
319 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | 317 | QDate nextd; |
318 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | ||
319 | if ( last ) { | ||
320 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | ||
321 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | ||
322 | } | ||
320 | } | 323 | } |
321 | } else { | 324 | } else { |
322 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 325 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |