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) (unidiff)
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()
322 322
323// kdDebug() << "updateView() -> daymatrix->updateView()" << endl; 323// kdDebug() << "updateView() -> daymatrix->updateView()" << endl;
324 daymatrix->updateView(); 324 daymatrix->updateView();
325 325 int sub = 4;
326 if ( ! KGlobal::locale()->weekStartsMonday() )
327 --sub;
326 // set the week numbers. 328 // set the week numbers.
327 for(i = 0; i < 6; i++) { 329 for(i = 0; i < 6; i++) {
328 QString weeknum;
329 // remember, according to ISO 8601, the first week of the year is the 330 // remember, according to ISO 8601, the first week of the year is the
330 // first week that contains a thursday. Thus we must subtract off 4, 331 // first week that contains a thursday. Thus we must subtract off 4,
331 // not just 1. 332 // not just 1.
332 333
333 //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear(); 334 //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear();
334 int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4))); 335 int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-sub)));
335 336 int weekNo;
336 int add = 0;
337 if ( ! KGlobal::locale()->weekStartsMonday() )
338 ++add;
339 if (dayOfYear % 7 != 0) 337 if (dayOfYear % 7 != 0)
340 weeknum.setNum(dayOfYear / 7 + 1+add); 338 weekNo = (dayOfYear / 7 + 1);
341 else 339 else
342 weeknum.setNum(dayOfYear / 7 +add); 340 weekNo = (dayOfYear / 7);
343 weeknos[i]->setText(weeknum); 341 weeknos[i]->setText(QString::number( weekNo ));
344 } 342 }
345 343
346 setUpdatesEnabled( true ); 344 setUpdatesEnabled( true );