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:
@@ -262,9 +262,11 @@ wxCalendarCtrl::HitTest(const wxPoint& pos,
|
|||||||
bool wxCalendarCtrl::SetDate(const wxDateTime& dt)
|
bool wxCalendarCtrl::SetDate(const wxDateTime& dt)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( dt.IsValid(), false, "invalid date" );
|
wxCHECK_MSG( dt.IsValid(), false, "invalid date" );
|
||||||
|
wxDateTime newdt(dt);
|
||||||
|
newdt.ResetTime();
|
||||||
|
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
dt.GetAsMSWSysTime(&st);
|
newdt.GetAsMSWSysTime(&st);
|
||||||
if ( !MonthCal_SetCurSel(GetHwnd(), &st) )
|
if ( !MonthCal_SetCurSel(GetHwnd(), &st) )
|
||||||
{
|
{
|
||||||
wxLogDebug(wxT("DateTime_SetSystemtime() failed"));
|
wxLogDebug(wxT("DateTime_SetSystemtime() failed"));
|
||||||
@@ -272,7 +274,7 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& dt)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_date = dt;
|
m_date = newdt;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user