git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31988
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxDateTime dt;
dt.ParseFormat(m_txt->GetValue(), m_format);
wxDateTime dt;
dt.ParseFormat(m_txt->GetValue(), m_format);
{
if ( !HasFlag(wxDP_ALLOWNONE) )
dt = m_currentDate;
}
{
if ( !HasFlag(wxDP_ALLOWNONE) )
dt = m_currentDate;
}
- if (!dt.IsValid())
- m_txt->SetValue(wxEmptyString);
- else
- m_txt->SetValue(dt.Format(m_format));
+ m_txt->SetValue(dt.IsValid()? dt.Format(m_format) : wxString());
// notify that we had to change the date after validation
// notify that we had to change the date after validation
- if (m_currentDate != dt)
+ if ( (dt.IsValid() && m_currentDate != dt) ||
+ (!dt.IsValid() && m_currentDate.IsValid()) )
{
m_currentDate = dt;
wxDateEvent event(this, dt, wxEVT_DATE_CHANGED);
{
m_currentDate = dt;
wxDateEvent event(this, dt, wxEVT_DATE_CHANGED);