Version: 0.5.1 (using KDE 3.5.2 Level "a" , SUSE 10.0 UNSUPPORTED) Compiler: Target: i586-suse-linux OS: Linux (i686) release 2.6.13-15.10-default The Sunday Day is in the wrong field. This could be because of the English way of looking at calendars verses European "Mondays first" way.
I can confirm this: if you have set your calendar to start the week with Sunday in kcontrol, then the headings are sun to sat, but the calendar itself is still mon to sun.
Btw, I'm using 1.6 svn right now, trying to use kplato for the current deathmarch project at work.
SVN commit 576264 by danders: Fix the calendar table dialog when the first day of the week is not monday. CCBUG:129889 M +22 -4 kptdatetable.cc M +6 -9 kptdatetable.h --- branches/koffice/1.6/koffice/kplato/kptdatetable.cc #576263:576264 @@ -1,7 +1,7 @@ /* This file is part of the KDE project Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org) (C) 1998-2001 Mirko Boehm (mirko@kde.org) - (C) 2004 Dag Andersen <danders@get2net.dk> + (C) 2004-2006 Dag Andersen <danders@get2net.dk> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -505,7 +505,7 @@ } temp.setYMD(date.year(), date.month(), 1); - firstday=temp.dayOfWeek(); + firstday=column(KGlobal::locale()->calendar()->dayOfWeek(temp)); if(firstday==1) firstday=8; // Reserve row 1 for previous month numdays=date.daysInMonth(); if(date.month()==1) { // set to december of previous year @@ -541,9 +541,9 @@ //m_selectedDates.clear(); temp.setYMD(date.year(), date.month(), 1); - firstday=temp.dayOfWeek(); + firstday=column(KGlobal::locale()->calendar()->dayOfWeek(temp)); if(firstday==1) firstday=8; - //kdDebug()<<k_funcinfo<<"date="<<temp.toString()<<"day="<<temp.dayOfWeek()<<" firstday="<<firstday<<endl; + //kdDebug()<<k_funcinfo<<"date="<<temp<<"day="<<(KGlobal::locale()->calendar()->dayOfWeek(temp))<<" firstday="<<firstday<<endl; numdays=date.daysInMonth(); if(date.month()==1) { // set to december of previous year temp.setYMD(date.year()-1, 12, 1); @@ -654,6 +654,24 @@ return m_markedDates[date.toString()]; } +QDate DateTable::getDate(int pos) const { + return QDate(date.year(), date.month(), 1).addDays(pos-firstday); +} + +int DateTable::weekday(int col) const { + int day = col - m_dateStartCol + KGlobal::locale()->weekStartDay(); + if (day > 7) day %= 7; + //kdDebug()<<k_funcinfo<<"col="<<col<<" day="<<day<<" StartCol="<<m_dateStartCol<<" weekStartDay="<<KGlobal::locale()->weekStartDay()<<endl; + return day; +} + +int DateTable::column(int weekday) const { + int col = weekday - KGlobal::locale()->weekStartDay(); + if (col < 0) col += 7; + //kdDebug()<<k_funcinfo<<"col="<<col<<" day="<<col<<" StartCol="<<m_dateStartCol<<" weekStartDay="<<KGlobal::locale()->weekStartDay()<<endl; + return col + m_dateStartCol; +} + void DateTable::clear() { clearSelection(); m_markedDates.clear(); --- branches/koffice/1.6/koffice/kplato/kptdatetable.h #576263:576264 @@ -1,7 +1,7 @@ /* This file is part of the KDE project Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org) (C) 1998-2001 Mirko Boehm (mirko@kde.org) - (C) 2004 Dag Andersen <danders@get2net.dk> + (C) 2004-2006 Dag Andersen <danders@get2net.dk> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -332,20 +332,17 @@ void updateMarkedCells(); void updateCells(); - QDate getDate(int pos) { return QDate(date.year(), date.month(), 1).addDays(pos-firstday); } - + QDate getDate(int pos) const; + /** * pos can be 1..42 * row starts at 1, col depends on wether weeks are presented (in col 0) */ int position(int row, int col) { return ((7 * (row - 1)) + col - m_dateStartCol + 1); } - int weekday(int col) { - int day = col - m_dateStartCol + KGlobal::locale()->weekStartDay(); - if (day > 7) day %= 7; - return day; - } - + int weekday(int col) const; + int column(int weekday) const; + void paintWeekday(QPainter *painter, int col); void paintWeekNumber(QPainter *painter, int row); void paintDay(QPainter *painter, int row, int col);
*** Bug has been marked as fixed ***.