summaryrefslogtreecommitdiffabout
path: root/korganizer/kdatenavigator.cpp
Unidiff
Diffstat (limited to 'korganizer/kdatenavigator.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kdatenavigator.cpp7
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
@@ -240,28 +240,31 @@ void KDateNavigator::updateView()
240 daymatrix->updateView(); 240 daymatrix->updateView();
241 241
242 // set the week numbers. 242 // set the week numbers.
243 for(i = 0; i < 6; i++) { 243 for(i = 0; i < 6; i++) {
244 QString weeknum; 244 QString weeknum;
245 // remember, according to ISO 8601, the first week of the year is the 245 // remember, according to ISO 8601, the first week of the year is the
246 // first week that contains a thursday. Thus we must subtract off 4, 246 // first week that contains a thursday. Thus we must subtract off 4,
247 // not just 1. 247 // not just 1.
248 248
249 //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear(); 249 //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear();
250 int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4))); 250 int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4)));
251 251
252 int add = 0;
253 if ( ! KGlobal::locale()->weekStartsMonday() )
254 ++add;
252 if (dayOfYear % 7 != 0) 255 if (dayOfYear % 7 != 0)
253 weeknum.setNum(dayOfYear / 7 + 1); 256 weeknum.setNum(dayOfYear / 7 + 1+add);
254 else 257 else
255 weeknum.setNum(dayOfYear / 7); 258 weeknum.setNum(dayOfYear / 7 +add);
256 weeknos[i]->setText(weeknum); 259 weeknos[i]->setText(weeknum);
257 } 260 }
258 261
259 setUpdatesEnabled( true ); 262 setUpdatesEnabled( true );
260// kdDebug() << "updateView() -> repaint()" << endl; 263// kdDebug() << "updateView() -> repaint()" << endl;
261 repaint(); 264 repaint();
262 daymatrix->repaint(); 265 daymatrix->repaint();
263} 266}
264 267
265void KDateNavigator::updateConfig() 268void KDateNavigator::updateConfig()
266{ 269{
267 int day; 270 int day;