Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kdatenavigator.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index 7d0c516..b420351 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -244,20 +244,23 @@ void KDateNavigator::updateView() 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; if (dayOfYear % 7 != 0) - weeknum.setNum(dayOfYear / 7 + 1); + weeknum.setNum(dayOfYear / 7 + 1+add); else - weeknum.setNum(dayOfYear / 7); + weeknum.setNum(dayOfYear / 7 +add); weeknos[i]->setText(weeknum); } setUpdatesEnabled( true ); // kdDebug() << "updateView() -> repaint()" << endl; repaint(); daymatrix->repaint(); } |