Ticket #2182 (new defect)
trac.ini setting for date and time formats
| Reported by: | tdkim@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.12 |
| Component: | roadmap | Version: | devel |
| Severity: | major | Keywords: | i18n dateformat |
| Cc: | jae+trac@…, tdkim@…, manuzhai@…, Shevchenko, linuxadmin@…, a.a.vykhodtsev@…, iaindb@… |
Description
Hi all. Thanks for Trac...
I used Korean date/time format.
This is korean date/time format. 2005년 10월 06일 19시 36분 41초 YYYY년 MM월 DD일 hh시 mm분 ss초
When I enter "10", "11", "12" in month field, Trac shows the error message, "Invalid Date format".
When I enter "010", "011", "012" in month field, There is no error. If I enter "01", ... ,"09" in month field, there is no error too.
My Apache config is:
SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnv /home/SVN/MYREPO.TRAC PythonOption TracLocale "ko_KR.utf8"
I tested it in Trac revision 2328 from SVN repo.
Attachments
Change History
follow-up: ↓ 31 Changed 16 months ago by techtonik <techtonik@…>
Dropdown box above is awful. It is better to use simple text field in admin interface, which will contain format string stored in trac.ini There should be a link to Trac wiki page with reference about pattern syntax description and table of common formats.
Remember that Trac is itself not an easy system to install for ordinary user and it makes little sense wasting time for implementing feature for trac "admins" who are unable to understand standard date pattern from reference.
in reply to: ↑ 30 ; follow-up: ↓ 32 Changed 16 months ago by anonymous
Replying to techtonik <techtonik@gmail.com>:
Dropdown box above is awful.
Ok, putting an example date within the dropdown itself was not a bright idea (well, at least as one can have that left aligned and the name right aligned), so it's better to have only a list of names and show how it will look like after update (similar to the selection of the time zone).
What you seem to have missed is that this will be a user preference, not a system wide setup. The admin would eventually be able to add more choices and a system default. This will be setup in the trac.ini.
Changed 16 months ago by techtonik <techtonik@…>
I think it is too complicated with names and drop-down boxes. I doubt that this option will be popular at all if Trac chooses something more intuitive than US mm/dd/yyyy format, e.g. yyyy-mm-dd
I never use the date of my locale. What I need is to avoid the users being confused. If I set up the most intuitive format like yyyy-mm-dd - I bet nobody will complain to change the date even if dd-mm-yyyy is more familiar here, but I do not know if it is a format of my native locale or not.
So I think that for 0.11 a date format specifier is a must, but let it be simple. In any case if there will be an option on this site - you can calculate how many users will actually use it.
Changed 15 months ago by cboos
#5345 marked as duplicate, and states quite concisely the need for having user specific setting:
If a distributed team working on the project it is beneficial to have correct date/time format for everybody. Site-global settings described in the documentation are not appropriate. E.g. some developers working in US, some in Europe...
Changed 15 months ago by techtonik <techtonik@…>
The problem is caused not by absence of ISO, but by confusion of U.S. mm/dd/yyyy with dd/mm/yyyy in other countries. It is impossible to say which format is used in date like 12/03/2004 without looking anywhere else. On the other side ISO removes this ambiguity.
Changed 14 months ago by techtonik <techtonik@…>
Should we split this one in two - "separate trac-wide date setting with default ISO format" and "personalized date settings"?
Changed 5 weeks ago by cboos
#1690 closed as duplicate.
Besides locale related formats, it should be possible to choose ISO 8601 format.
While using Babel for some date format related stuff might be nice, I don't think we should rely on it. Instead, we should do something similar as we did for the datetime switch and pytz: have our own minimal implementation and allow the use of a more comprehensive (but optional) external dependency.


