enthought / enthought/traitsui

Unable to change date format for simple style DateEditor

Open
#806 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

The `DateEditor` factory has a `strftime` trait that allows you to change the date format of the readonly editor. However, there is no way to change the format of the simple editor.

The Qt simple date editor makes reference to a `qt_date_format` trait on the factory:

https://github.com/enthought/traitsui/blob/3a3d17b8ed4ad10874eddea6f2aa9c7203d89aea/traitsui/qt4/date_editor.py#L43-L45

However, the factory class does not actually have this trait. Several other ghost traits on the factory are also referenced: `maximum_date_name`, `minimum_date_name`, `maximum_date`, `minimum_date`.

From @corranwebster:

> I think the correct design is to have the factory give the option of “long” or “short” date formats, and then use what the locale returns; and maybe have another option like “iso” which does “YYYY-MM-DD”. That should cover most bases.

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.