Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweekheaderimpl.cpp | 12 |
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 @@ -71,16 +71,20 @@ void DateBookWeekHeader::pickDate() 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)); } @@ -95,7 +99,11 @@ void DateBookWeekHeader::setDate(const QDate &d) { 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; |