summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.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/mainwindow.cpp
parent4034290f894ff7d1b0cf1197078e0ed832566bb7 (diff)
downloadkdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.zip
kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.gz
kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.bz2
montview sunday fix
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 2da592b..8e52968 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1478,33 +1478,11 @@ QString MainWindow::syncFileName()
return QString( "/tmp/synccalendar.ics" );
#endif
}
+#include "koglobals.h"
+#include <kcalendarsystem.h>
void MainWindow::updateWeek(QDate seda)
{
- int weekNum = 0;
- QDate d = QDate ( seda.year(), 1,1);
- seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday
- if ( seda.addDays(6).year() != seda.year() ) {
- if ( seda.year() != d.year() ) {
- if ( d.dayOfWeek() > 4 )
- d = QDate ( seda.year(), 1,1);
- else
- weekNum = 1;
- } else {
- QDate dd( seda.year()+1, 1,1);
- if ( dd.dayOfWeek() <= 4 )
- weekNum = 1;
- }
- }
- if ( weekNum == 0 ){
- int dow = d.dayOfWeek();
- if ( dow <= 4 )
- d = d.addDays( 1-dow );
- else // 5,6,7
- d = d.addDays( 8-dow );
- // we have the first week of the year.we are on monday
- weekNum = d.daysTo( seda ) / 7 +1;
- }
-
+ int weekNum = KGlobal::locale()->weekNum ( seda );
mWeekPixmap.fill( mWeekBgColor );
QPainter p ( &mWeekPixmap );
p.setFont( mWeekFont );