summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 92fd59c..3a16fe6 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3606,21 +3606,27 @@ void CalendarView::showDates(const DateList &selectedDates)
3606 } 3606 }
3607 } 3607 }
3608 3608
3609 QDate date = selectedDates.first();
3610 if ( ! date.isValid() ) {
3611 topLevelWidget()->setCaption("");
3612 return;
3613 }
3614
3609 QString selDates; 3615 QString selDates;
3610 selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); 3616 selDates = KGlobal::locale()->formatDate( date, true);
3611 if (selectedDates.first() < selectedDates.last() ) 3617 if (selectedDates.first() < selectedDates.last() )
3612 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3618 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
3613 else { 3619 else {
3614 QString addString; 3620 QString addString;
3615 if ( selectedDates.first() == QDateTime::currentDateTime().date() ) 3621 if ( date == QDateTime::currentDateTime().date() )
3616 addString = i18n("Today"); 3622 addString = i18n("Today");
3617 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) 3623 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
3618 addString = i18n("Tomorrow"); 3624 addString = i18n("Tomorrow");
3619 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) 3625 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
3620 addString = i18n("Yesterday"); 3626 addString = i18n("Yesterday");
3621 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) 3627 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
3622 addString = i18n("Day before yesterday"); 3628 addString = i18n("Day before yesterday");
3623 else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) 3629 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
3624 addString = i18n("Day after tomorrow"); 3630 addString = i18n("Day after tomorrow");
3625 if ( !addString.isEmpty() ) { 3631 if ( !addString.isEmpty() ) {
3626 topLevelWidget()->setCaption( addString+", " + selDates ); 3632 topLevelWidget()->setCaption( addString+", " + selDates );