X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95c336d620c49d16f2c6ceb52779bb657bb59494..a9a56347b84be54a9d48df2cfe08ddf761aaf491:/samples/widgets/datepick.cpp diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index 12ee2f8fcd..e553c3581f 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -223,15 +223,15 @@ void DatePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void DatePickerWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) { - long day = 0, month = 0, year = 0; + 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(wxDateTime::wxDateTime_t(day), - wxDateTime::Month(month), - year); - if(someDay.IsValid()) + const wxDateTime someDay(day, wxDateTime::Month(month - 1), year); + if ( someDay.IsValid() ) { m_datePicker->SetValue(someDay); }