wxWidgets 3.1.5 wxGridCellDateEditor format

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ArcTheSpark
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Apr 15, 2021 10:27 am

wxWidgets 3.1.5 wxGridCellDateEditor format

Post by ArcTheSpark » Thu Apr 15, 2021 11:51 am

Good Day,
I am using wxWidgets 3.1.5 and seem to be misunderstanding how to set the format of a wxGridCellDateEditor.

Below is an example:
ps. m_grid_journal is a wxGrid.

Code: Select all

wxGridCellDateEditor *transDate = new wxGridCellDateEditor(wxString("%d-%m-%Y"));
m_grid_journal->SetCellEditor(row, 0, transDate);
when I click on the cell that has the wxGridCellDateEditor.
The date always changes to the following format ("%Y/%m/%d") eg (2021/04/15)
and not to ("%d-%m-%Y") eg (15-04-2021).

Once the date is chosen I would like it to display in the day-month-year format.
can someone help me in what I am doing wrong.

Thank you.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5156
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidgets 3.1.5 wxGridCellDateEditor format

Post by ONEEYEMAN » Thu Apr 15, 2021 12:33 pm

Hi,
What OS/wxWidgets version?
What locale(s) do you have installed on the system?

Thank you.

ArcTheSpark
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Apr 15, 2021 10:27 am

Re: wxWidgets 3.1.5 wxGridCellDateEditor format

Post by ArcTheSpark » Thu Apr 15, 2021 12:48 pm

Hi ONEEYEMAN, thank you.

I'm currently using wxWidgets 3.1.5.
It happens on windows 10, Ubuntu 20.10 and macOS Catalina.

On Windows and Ubuntu I have tried / use:
locale English (South Africa) en_ZA
But have also tested using English (UK) en_GB.

On Mac I have only tried English (South Africa) en_ZA.

My understanding is that if I pass through a format string, it should use that instead of the current locale / OS locale.

Code: Select all

wxGridCellDateEditor *transDate = new wxGridCellDateEditor(wxString("%d-%m-%Y"));
Thank you

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5156
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidgets 3.1.5 wxGridCellDateEditor format

Post by ONEEYEMAN » Thu Apr 15, 2021 1:48 pm

Hi
Which format is used by the renderer?

Thank you.

Post Reply