From: Vadim Zeitlin Date: Sun, 23 Aug 2009 22:24:54 +0000 (+0000) Subject: Show the current range of valid dates in the calendar sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7b342d55c35ca1fe440363cd62ef56cd5322ed00 Show the current range of valid dates in the calendar sample. See #11081 (point C). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 493f42850d..a6c6007c51 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -799,6 +799,18 @@ void MyPanel::LimitDateRange(bool on) if ( m_calendar->SetDateRange(today - diff, today + diff) ) { wxLogStatus("Date range limited to 3 months around today."); + wxDateTime firstValidDate; + wxDateTime lastValidDate; + if ( m_calendar->GetDateRange(&firstValidDate, &lastValidDate) ) + { + wxLogMessage("First valid date: %s, last valid date: %s", + firstValidDate.FormatISODate(), + lastValidDate.FormatISODate()); + } + else + { + wxLogWarning("Failed to get back the valid dates range."); + } } else {