CVS commit by bieker: Made it work again for calendars where the week is not starting at monday. M +2 -18 kdatetbl.cpp 1.68 --- kdelibs/kdeui/kdatetbl.cpp #1.67:1.68 @@ -192,11 +192,4 @@ KDateTable::paintCell(QPainter *painter, // First day of month calendar->setYMD(pCellDate, calendar->year(date), calendar->month(date), 1); - pCellDate = calendar->addDays(pCellDate, firstWeekDay - calendar->dayOfWeek(pCellDate)); - // The first day of the month should never be the first day in the calendar - if (calendar->day(pCellDate) == 1 ) - pCellDate = calendar->addDays(pCellDate, -7); - - pCellDate = calendar->addDays(pCellDate, pos); - kdDebug() << "MyDate: " << pCellDate.toString() << endl; if ( firstWeekDay < 4 ) @@ -204,4 +197,5 @@ KDateTable::paintCell(QPainter *painter, else pos += firstWeekDay - 7; + pCellDate = calendar->addDays(pCellDate, pos-firstday); text = calendar->dayString(pCellDate, true); if(possetPen(gray); } else { // paint a day of the current month - //text.setNum(pos-firstday+1); if ( d->useCustomColors ) { @@ -263,8 +250,5 @@ KDateTable::paintCell(QPainter *painter, } - QDate cur_date = QDate::currentDate(); - if ( (calendar->year(date) == calendar->year(cur_date)) && - (calendar->month(date) == calendar->month(cur_date)) && - (firstday+calendar->day(cur_date)-1 == pos) ) + if ( pCellDate == QDate::currentDate() ) { painter->setPen(KGlobalSettings::textColor());