]> git.saurik.com Git - wxWidgets.git/commitdiff
Use correct month in the date picker page of the widgets sample.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Mar 2011 10:37:35 +0000 (10:37 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Mar 2011 10:37:35 +0000 (10:37 +0000)
Months returned by wxDateTime::GetMonth() start from 0 while people mostly
expect to have 1-based months in the UI.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/widgets/datepick.cpp

index c0646f0b890680e10050f45ffa16fdc9d512ee1c..1ce550538b3016ff87355906bfdafb9d60736d49 100644 (file)
@@ -186,7 +186,7 @@ void DatePickerWidgetsPage::Reset()
 
     m_datePicker->SetValue(today);
     m_day->SetValue(wxString::Format(wxT("%d"), today.GetDay()));
-    m_month->SetValue(wxString::Format(wxT("%d"), today.GetMonth()));
+    m_month->SetValue(wxString::Format(wxT("%d"), today.GetMonth() + 1));
     m_year->SetValue(wxString::Format(wxT("%d"), today.GetYear()));
 }