From: Stefan Csomor Date: Wed, 12 Jun 2013 17:55:43 +0000 (+0000) Subject: as the native control doesn't check the min max values, we do it ourselves X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6f2361366936ae4384ec9c81aa82442641c0f342 as the native control doesn't check the min max values, we do it ourselves git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/datetimectrl.mm b/src/osx/cocoa/datetimectrl.mm index 1b0870c188..263a8aa6e8 100644 --- a/src/osx/cocoa/datetimectrl.mm +++ b/src/osx/cocoa/datetimectrl.mm @@ -78,7 +78,12 @@ public: virtual void SetDateTime(const wxDateTime& dt) { - [View() setDateValue: NSDateFromWX(dt)]; + wxDateTime dtFrom, dtTo; + + if ( GetDateRange(&dtFrom,&dtTo) == false || + ( (!dtFrom.IsValid() || dtFrom <= dt) && + (!dtTo.IsValid() || dt <= dtTo ) ) ) + [View() setDateValue: NSDateFromWX(dt)]; } virtual wxDateTime GetDateTime() const