X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95c336d620c49d16f2c6ceb52779bb657bb59494..d8eff331e23435d9d8d6483a40f6fd9997a13f87:/samples/widgets/datepick.cpp?ds=sidebyside diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index 12ee2f8fcd..80261da8f5 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -185,9 +185,9 @@ void DatePickerWidgetsPage::Reset() const wxDateTime today = wxDateTime::Today(); m_datePicker->SetValue(today); - m_day->SetValue(wxString::Format(_T("%d"), today.GetDay())); - m_month->SetValue(wxString::Format(_T("%d"), today.GetMonth())); - m_year->SetValue(wxString::Format(_T("%d"), today.GetYear())); + m_day->SetValue(wxString::Format(wxT("%d"), today.GetDay())); + m_month->SetValue(wxString::Format(wxT("%d"), today.GetMonth())); + m_year->SetValue(wxString::Format(wxT("%d"), today.GetYear())); } void DatePickerWidgetsPage::CreateDatePicker() @@ -223,26 +223,26 @@ 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); } else { - wxLogError(_T("Date is invalid")); + wxLogError(wxT("Date is invalid")); } } else { - wxLogError(_T("One of inputs is not number")); + wxLogError(wxT("One of inputs is not number")); } }