X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2995b6881211ea19c629497d50dd31028f2fbd17..02fd8b9b6186623ed61019ac7e69ed9a4ef16773:/samples/widgets/datepick.cpp diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index 4295abc9c2..e553c3581f 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -223,12 +223,14 @@ void DatePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void DatePickerWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) { - long day, month, year; + long day = 0, + month = 0, + year = 0; if ( m_day->GetValue().ToLong(&day) && m_month->GetValue().ToLong(&month) && m_year->GetValue().ToLong(&year) ) { - const wxDateTime someDay(day, wxDateTime::Month(month), year); + const wxDateTime someDay(day, wxDateTime::Month(month - 1), year); if ( someDay.IsValid() ) { m_datePicker->SetValue(someDay);