Opened 6 years ago

Last modified 4 months ago

#11050 new enhancement

Implement wxDatePickerCtrl::SetFormat()

Reported by: nikospic Owned by:
Priority: low Milestone:
Component: GUI-all Version: 3.0.2
Keywords: wxDatePickerCtrl SetFormat Cc:
Blocked By: Blocking:
Patch: no


The SetFormat is not available (public or protected) for wxDatePickerCtrl
and doesn't seem available its generic version (although that is what the documentation says)

(it seems to be only implemented in wxCalendarComboPopup as private)

I understand that "The native version always uses the current system locale" however in some applications one needs to have a specific date format not necessarily compatible with the locale but rather with the industrial standards (e.g. airline industry).

Maybe we should be given the choice of changing the format, like we can do it for wxDateTime, even if we have to inherit from wxDatePickerCtrl.

Change History (3)

comment:1 Changed 6 years ago by vadz

  • Component changed from wxUniv (any port) to GUI-all
  • Priority changed from normal to low
  • Status changed from new to confirmed
  • Summary changed from wxDatePickerCtrl needs SetFormat availability to Implement wxDatePickerCtrl::SetFormat()

And I just decided that we didn't need it (see #10988) and removed last traces of it...

If you do need it in wxUniv-only then it shouldn't be difficult to implement it for it as it's easy in the generic version. Doing it for wxMSW would be more difficult but still possible, see DateTime_SetFormat() documentation in MSDN.

Anyhow, patches implementing this would be welcome but I consider it low priority as the default format is fine for the majority of programs and so am unlikely to work on this myself.

comment:2 Changed 4 months ago by buhtz

  • Priority changed from low to normal
  • Status changed from confirmed to infoneeded_new
  • Version changed from 2.8.10 to 3.0.2

There is definitly a need for that methode. Even the GenericDatePickerCtrl should act like the native ones: It should use the systems local format to display its date as a string. So the current state is for me a BUG.

I didn't understand the discussion in #10988 and why the methode was removed before 2.8 in the generic version.

comment:3 Changed 4 months ago by vadz

  • Priority changed from normal to low
  • Status changed from infoneeded_new to new

wxGenericDatePickerCtrl should definitely use the current locale date format. If it doesn't, it's (another) bug. But this ticket is not about this, but about allowing to use any format for dates. While this could be potentially useful too, of course, it's much more difficult to implement.

Note: See TracTickets for help on using tickets.