From 7313db77a7c6d9606c258145994b27ab993f0883 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 9 Feb 2010 01:32:21 +0000 Subject: [PATCH] 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 --- src/msw/calctrl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index cf0de6e223..56ac3fdb18 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -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; } -- 2.50.0