From kde-commits Mon Sep 04 05:30:32 2006 From: Thomas Braxton Date: Mon, 04 Sep 2006 05:30:32 +0000 To: kde-commits Subject: KDE/kdelibs/kdeui/widgets Message-Id: <1157347832.265934.8386.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115734784512746 SVN commit 580630 by braxton: fix to select the correct day of the month when changing the date with the month drop-down. forward port of commit 580628 M +2 -4 kdatepicker.cpp --- trunk/KDE/kdelibs/kdeui/widgets/kdatepicker.cpp #580629:580630 @@ -358,10 +358,8 @@ int day = calendar->day(date); // ----- construct a valid date in this month: - //date.setYMD(date.year(), month, 1); - //date.setYMD(date.year(), month, qMin(day, date.daysInMonth())); - calendar->setYMD(date, calendar->year(date), item->data().toInt(), - qMin(day, calendar->daysInMonth(date))); + calendar->setYMD(date, calendar->year(date), item->data().toInt(), 1); + date = date.addDays(qMin(day, calendar->daysInMonth(date)) - 1); // ----- set this month setDate(date); }