-rw-r--r-- | korganizer/koagendaview.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index c5acafd..6428757 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -638,6 +638,7 @@ void KOAgendaView::createDayLabels() dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); dayLabel->show(); DateList::ConstIterator dit; + bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { QDate date = *dit; // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); @@ -682,7 +683,22 @@ void KOAgendaView::createDayLabels() default: break; } - + if ( oneday ) { + QString addString; + if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) + addString = i18n("Today"); + else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) + addString = i18n("Tomorrow"); + else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) + addString = i18n("Yesterday"); + else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) + addString = i18n("Day before yesterday"); + else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) + addString = i18n("Day after tomorrow"); + if ( !addString.isEmpty() ) { + str = addString+", " + str; + } + } dayLabel->setText(str); dayLabel->setAlignment(QLabel::AlignHCenter); if (date == QDate::currentDate()) { |