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:
@@ -28,6 +28,7 @@
|
|||||||
#include "wx/numformatter.h"
|
#include "wx/numformatter.h"
|
||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
#include "wx/renderer.h"
|
#include "wx/renderer.h"
|
||||||
|
#include "wx/uilocale.h"
|
||||||
|
|
||||||
#include "wx/generic/private/grid.h"
|
#include "wx/generic/private/grid.h"
|
||||||
#include "wx/private/window.h"
|
#include "wx/private/window.h"
|
||||||
@@ -160,7 +161,7 @@ wxGridCellDateRenderer::wxGridCellDateRenderer(const wxString& outformat)
|
|||||||
{
|
{
|
||||||
if ( outformat.empty() )
|
if ( outformat.empty() )
|
||||||
{
|
{
|
||||||
m_oformat = "%x"; // Localized date representation.
|
m_oformat = wxGetUIDateFormat();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#include "wx/tokenzr.h"
|
#include "wx/tokenzr.h"
|
||||||
#include "wx/renderer.h"
|
#include "wx/renderer.h"
|
||||||
#include "wx/datectrl.h"
|
#include "wx/datectrl.h"
|
||||||
|
#include "wx/uilocale.h"
|
||||||
|
|
||||||
#include "wx/generic/gridsel.h"
|
#include "wx/generic/gridsel.h"
|
||||||
#include "wx/generic/grideditors.h"
|
#include "wx/generic/grideditors.h"
|
||||||
@@ -1852,7 +1853,7 @@ wxGridCellDateEditor::wxGridCellDateEditor(const wxString& format)
|
|||||||
void wxGridCellDateEditor::SetParameters(const wxString& params)
|
void wxGridCellDateEditor::SetParameters(const wxString& params)
|
||||||
{
|
{
|
||||||
if ( params.empty() )
|
if ( params.empty() )
|
||||||
m_format = "%x";
|
m_format = wxGetUIDateFormat();
|
||||||
else
|
else
|
||||||
m_format = params;
|
m_format = params;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user