enthought / enthought/traitsui

wx simple DateEditor view shows a date despite the underlying value being none

Open
#1,135 0 comments 0 reactions 0 assignees View on GitHub
priority: low toolkit: WxPython4 type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

This is an analogous issue to #967. In Qt with a date that is None the default shown in 01/01/2000, whereas on wx it is the current date.

As mentioned on the Qt issue (see the reference link), I am not sure if Qt will be able to accept a None value without some decently ugly workarounds (at least from what I have seen so far). It would be good for the behavior to be the same between Qt and wx (so if we are unable to set Qt to none we may want to change it to be the current date to match wx in which case this is no longer a valid issue, or we may want to do something else entirely)

Also, for wx the docs mention a style option to allow None as a date (we currently already use this):
"wx.adv.DP_ALLOWNONE: With this style, the control allows the user to not enter any valid date at all. Without it - the default - the control always has some valid date. This style is not supported in OSX/Cocoa native version."

I briefly was looking into fixing this, but being that Im on OSX was unsuccessful. I may take a look at it on a linux vm later, but regardless it seems having a None valued date may not be allowed on OSX in which case we may want to handle this differently.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.