summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweekheaderimpl.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index 770410e..84b4f1b 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -97,23 +97,24 @@ void DateBookWeekHeader::setDate( int y, int m, int d )
97void DateBookWeekHeader::setDate(const QDate &d) { 97void DateBookWeekHeader::setDate(const QDate &d) {
98 int year,week,dayofweek; 98 int year,week,dayofweek;
99 date=d; 99 date=d;
100 dayofweek=d.dayOfWeek(); 100 dayofweek=d.dayOfWeek();
101 if(bStartOnMonday) 101 if(bStartOnMonday)
102 dayofweek--; 102 dayofweek--;
103 else if( dayofweek == 7 ) 103 else if( dayofweek == 7 )
104 /* we already have the right day -7 would lead to the current week..*/ 104 // we already have the right day -7 would lead to the current week..
105 dayofweek = 0; 105 dayofweek = 0;
106 106
107 date=date.addDays(-dayofweek); 107 date=date.addDays(-dayofweek);
108 calcWeek(date,week,year,bStartOnMonday); 108 calcWeek(date,week,year,bStartOnMonday);
109 QDate start=date; 109 QDate start=date;
110 QDate stop=start.addDays(6); 110 QDate stop=start.addDays(6);
111 labelDate->setText( QString::number(start.day()) + "." + 111 labelDate->setText( QString::number(start.day()) + "." +
112 start.monthName(start.month()) + "-" + 112 Calendar::nameOfMonth( start.month()) + "-" +
113 QString::number(stop.day()) + "." + 113 QString::number(stop.day()) + "." +
114 start.monthName(stop.month()) +" ("+ 114 Calendar::nameOfMonth( stop.month()) +" ("+
115 tr("w")+":"+QString::number( week ) +")"); 115 tr("w")+":"+QString::number( week ) +")");
116 date = d; // bugfix: 0001126 - date has to be the selected date, not monday!
116 emit dateChanged(date); 117 emit dateChanged(date);
117} 118}
118 119
119void DateBookWeekHeader::setStartOfWeek( bool onMonday ) 120void DateBookWeekHeader::setStartOfWeek( bool onMonday )