author | zautrix <zautrix> | 2005-02-07 21:06:04 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-07 21:06:04 (UTC) |
commit | edaad9a9d7ede1b4bc50b9e758eaf32a5fbb547e (patch) (side-by-side diff) | |
tree | 7653e521f003a0c4e316530d38c09f3190c4edaf /korganizer/koeventviewer.cpp | |
parent | da5e47069d88fa9aa656423ce4c60bf505728e1c (diff) | |
download | kdepimpi-edaad9a9d7ede1b4bc50b9e758eaf32a5fbb547e.zip kdepimpi-edaad9a9d7ede1b4bc50b9e758eaf32a5fbb547e.tar.gz kdepimpi-edaad9a9d7ede1b4bc50b9e758eaf32a5fbb547e.tar.bz2 |
recurrence fixes
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-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 ) QString recurText = event->recurrence()->recurrenceText(); addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); - bool last; + bool ok; QDate start = QDate::currentDate(); - QDate next; - next = event->recurrence()->getPreviousDate( start , &last ); - if ( !last ) { - next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); + QDateTime next; + next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); + if ( ok ) { addTag("p",i18n("<b>Next recurrence is on:</b>") ); - addTag("p", KGlobal::locale()->formatDate( next, shortDate )); - QDateTime nextdt = QDateTime( next, event->dtStart().time()); - mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); + addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); + mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); } else { - addTag("p",i18n("<b>Last recurrence was on:</b>") ); - addTag("p", KGlobal::locale()->formatDate( next, shortDate )); + bool last; + QDate nextd; + nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); + if ( last ) { + addTag("p",i18n("<b>Last recurrence was on:</b>") ); + addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); + } } } else { mMailSubject += i18n(" - " )+event->dtStartStr( true ); |