X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c551dc29e77df0a9842ab072eb5f1ba0ad45e66b..7c60222510bc5e197b12f153c4bf05db66cb0f4a:/src/osx/cocoa/datetimectrl.mm 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