summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweekheaderimpl.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweekheaderimpl.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp
index ff7626f..770410e 100644
--- a/core/pim/datebook/datebookweekheaderimpl.cpp
+++ b/core/pim/datebook/datebookweekheaderimpl.cpp
@@ -67,39 +67,47 @@ void DateBookWeekHeader::pickDate()
m1->popup(mapToGlobal(labelDate->pos()+QPoint(0,labelDate->height())));
picker->setFocus();
}
void DateBookWeekHeader::nextMonth()
{
+ qWarning("nextMonth() " );
setDate(date.addDays(28));
}
void DateBookWeekHeader::prevMonth()
{
+ qWarning("prevMonth() " );
setDate(date.addDays(-28));
}
void DateBookWeekHeader::nextWeek()
{
+ qWarning("nextWeek() " );
setDate(date.addDays(7));
}
void DateBookWeekHeader::prevWeek()
{
+ qWarning("prevWeek() ");
setDate(date.addDays(-7));
}
void DateBookWeekHeader::setDate( int y, int m, int d )
{
setDate(QDate(y,m,d));
}
void DateBookWeekHeader::setDate(const QDate &d) {
int year,week,dayofweek;
date=d;
dayofweek=d.dayOfWeek();
- if(bStartOnMonday) dayofweek--;
+ if(bStartOnMonday)
+ dayofweek--;
+ else if( dayofweek == 7 )
+ /* we already have the right day -7 would lead to the current week..*/
+ dayofweek = 0;
+
date=date.addDays(-dayofweek);
-
calcWeek(date,week,year,bStartOnMonday);
QDate start=date;
QDate stop=start.addDays(6);
labelDate->setText( QString::number(start.day()) + "." +
start.monthName(start.month()) + "-" +
QString::number(stop.day()) + "." +