diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index 97baf6e944..6fcc0b63eb 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -375,10 +375,7 @@ bool wxDatePickerCtrlGeneric::Create(wxWindow *parent, m_popup->SetClientSize(panel->GetSize()); m_popup->Hide(); - if (!date.IsValid()) - date.Today(); - - SetValue(date); + SetValue(date.IsValid() ? date : wxDateTime::Today()); SetBestFittingSize(size);