diff --git a/include/wx/dvrenderers.h b/include/wx/dvrenderers.h index 85fcea0023..3b6857e971 100644 --- a/include/wx/dvrenderers.h +++ b/include/wx/dvrenderers.h @@ -527,6 +527,8 @@ public: virtual wxSize GetSize() const wxOVERRIDE; private: + wxString FormatDate() const; + wxDateTime m_date; }; #else // !wxUSE_DATEPICKCTRL diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 2c6fbe11d1..3824218eae 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -28,6 +28,8 @@ #include "wx/choice.h" #include "wx/imaglist.h" #include "wx/renderer.h" +#include "wx/uilocale.h" + #if wxUSE_ACCESSIBILITY #include "wx/access.h" #endif // wxUSE_ACCESSIBILITY @@ -1986,23 +1988,28 @@ bool wxDataViewDateRenderer::GetValue(wxVariant& value) const return true; } +wxString wxDataViewDateRenderer::FormatDate() const +{ + return m_date.Format(wxGetUIDateFormat()); +} + #if wxUSE_ACCESSIBILITY wxString wxDataViewDateRenderer::GetAccessibleDescription() const { - return m_date.FormatDate(); + return FormatDate(); } #endif // wxUSE_ACCESSIBILITY bool wxDataViewDateRenderer::Render(wxRect cell, wxDC* dc, int state) { - wxString tmp = m_date.FormatDate(); + wxString tmp = FormatDate(); RenderText( tmp, 0, cell, dc, state ); return true; } wxSize wxDataViewDateRenderer::GetSize() const { - return GetTextExtent(m_date.FormatDate()); + return GetTextExtent(FormatDate()); } #endif // (defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(__WXGTK__)) && wxUSE_DATEPICKCTRL