Ignore the time portion of the datetime object when setting the date.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-02-09 01:32:21 +00:00
parent aa48d3053d
commit 7313db77a7

View File

@@ -262,9 +262,11 @@ wxCalendarCtrl::HitTest(const wxPoint& pos,
bool wxCalendarCtrl::SetDate(const wxDateTime& dt)
{
wxCHECK_MSG( dt.IsValid(), false, "invalid date" );
wxDateTime newdt(dt);
newdt.ResetTime();
SYSTEMTIME st;
dt.GetAsMSWSysTime(&st);
newdt.GetAsMSWSysTime(&st);
if ( !MonthCal_SetCurSel(GetHwnd(), &st) )
{
wxLogDebug(wxT("DateTime_SetSystemtime() failed"));
@@ -272,7 +274,7 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& dt)
return false;
}
m_date = dt;
m_date = newdt;
return true;
}