]> git.saurik.com Git - wxWidgets.git/commitdiff
Ignore the time portion of the datetime object when setting the date.
authorRobin Dunn <robin@alldunn.com>
Tue, 9 Feb 2010 01:32:21 +0000 (01:32 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 9 Feb 2010 01:32:21 +0000 (01:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/calctrl.cpp

index cf0de6e22309ea6bcbabbd06715855ffb324ba4e..56ac3fdb18c225f1a0ebf840b96159bf0150ff68 100644 (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;
 }