Use wxUILocale for formatting dates in wxGrid

This is similar to the previous commit and ensures that the correct date
format is used even if setlocale() is not called.
This commit is contained in:
Vadim Zeitlin
2021-08-14 14:10:31 +01:00
parent 8fa853a3e2
commit d08fc7575e
2 changed files with 4 additions and 2 deletions

View File

@@ -28,6 +28,7 @@
#include "wx/numformatter.h"
#include "wx/tokenzr.h"
#include "wx/renderer.h"
#include "wx/uilocale.h"
#include "wx/generic/private/grid.h"
#include "wx/private/window.h"
@@ -160,7 +161,7 @@ wxGridCellDateRenderer::wxGridCellDateRenderer(const wxString& outformat)
{
if ( outformat.empty() )
{
m_oformat = "%x"; // Localized date representation.
m_oformat = wxGetUIDateFormat();
}
else
{

View File

@@ -36,6 +36,7 @@
#include "wx/tokenzr.h"
#include "wx/renderer.h"
#include "wx/datectrl.h"
#include "wx/uilocale.h"
#include "wx/generic/gridsel.h"
#include "wx/generic/grideditors.h"
@@ -1852,7 +1853,7 @@ wxGridCellDateEditor::wxGridCellDateEditor(const wxString& format)
void wxGridCellDateEditor::SetParameters(const wxString& params)
{
if ( params.empty() )
m_format = "%x";
m_format = wxGetUIDateFormat();
else
m_format = params;
}