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
@@ -72,2 +72,3 @@ void DateBookWeekHeader::nextMonth()
{
+ qWarning("nextMonth() " );
setDate(date.addDays(28));
@@ -76,2 +77,3 @@ void DateBookWeekHeader::prevMonth()
{
+ qWarning("prevMonth() " );
setDate(date.addDays(-28));
@@ -80,2 +82,3 @@ void DateBookWeekHeader::nextWeek()
{
+ qWarning("nextWeek() " );
setDate(date.addDays(7));
@@ -84,2 +87,3 @@ void DateBookWeekHeader::prevWeek()
{
+ qWarning("prevWeek() ");
setDate(date.addDays(-7));
@@ -96,5 +100,9 @@ void DateBookWeekHeader::setDate(const QDate &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);