summaryrefslogtreecommitdiffabout
path: root/korganizer/kdatenavigator.cpp
authorzautrix <zautrix>2005-03-28 23:39:37 (UTC)
committer zautrix <zautrix>2005-03-28 23:39:37 (UTC)
commit4e7c45695672ecdbd0cd14cac0ea29a8e134ee78 (patch) (side-by-side diff)
tree6815e055d6cb35d56d43f036261f5be9d2a9c350 /korganizer/kdatenavigator.cpp
parent4034290f894ff7d1b0cf1197078e0ed832566bb7 (diff)
downloadkdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.zip
kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.gz
kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.bz2
montview sunday fix
Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 38bddc2..2fca49e 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -322,25 +322,23 @@ void KDateNavigator::updateView()
// kdDebug() << "updateView() -> daymatrix->updateView()" << endl;
daymatrix->updateView();
-
+ int sub = 4;
+ if ( ! KGlobal::locale()->weekStartsMonday() )
+ --sub;
// set the week numbers.
for(i = 0; i < 6; i++) {
- QString weeknum;
// remember, according to ISO 8601, the first week of the year is the
// first week that contains a thursday. Thus we must subtract off 4,
// not just 1.
//ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear();
- int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4)));
-
- int add = 0;
- if ( ! KGlobal::locale()->weekStartsMonday() )
- ++add;
+ int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-sub)));
+ int weekNo;
if (dayOfYear % 7 != 0)
- weeknum.setNum(dayOfYear / 7 + 1+add);
+ weekNo = (dayOfYear / 7 + 1);
else
- weeknum.setNum(dayOfYear / 7 +add);
- weeknos[i]->setText(weeknum);
+ weekNo = (dayOfYear / 7);
+ weeknos[i]->setText(QString::number( weekNo ));
}
setUpdatesEnabled( true );