Fix return value of wxCalendarComboPopup::ParseDateTime()
Don't pretend that empty string represents a valid date, this made no sense and resulted in unwanted events with an invalid date on clearing the text part of the generic wxDatePickerCtrl.
This commit is contained in:
@@ -125,12 +125,9 @@ public:
|
|||||||
{
|
{
|
||||||
wxASSERT(pDt);
|
wxASSERT(pDt);
|
||||||
|
|
||||||
if ( !s.empty() )
|
|
||||||
{
|
|
||||||
pDt->ParseFormat(s, m_format);
|
pDt->ParseFormat(s, m_format);
|
||||||
if ( !pDt->IsValid() )
|
if ( !pDt->IsValid() )
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -253,7 +250,7 @@ private:
|
|||||||
virtual void SetStringValue(const wxString& s) wxOVERRIDE
|
virtual void SetStringValue(const wxString& s) wxOVERRIDE
|
||||||
{
|
{
|
||||||
wxDateTime dt;
|
wxDateTime dt;
|
||||||
if ( !s.empty() && ParseDateTime(s, &dt) )
|
if ( ParseDateTime(s, &dt) )
|
||||||
SetDate(dt);
|
SetDate(dt);
|
||||||
//else: keep the old value
|
//else: keep the old value
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user