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: | blocker | Keywords: | i18n dateformat |
| Cc: | jae+trac@…, tdkim@…, manuzhai@…, Shevchenko, linuxadmin@…, a.a.vykhodtsev@…, iaindb@…, everard@…, jurgen.erhard@…, daybreaker12@…, kirean@… |
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 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 2 years 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 12 months 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.
follow-up: ↓ 51 Changed 10 months ago by Everard Brown <everard@…>
Wouldn't it be nice for the date-time to be displayed in the format derived from the locale of the browser.
i.e. If the viewer is using:
- en-US they see 01/02/02
- en-GB they see 02/01/02
- de-DE they see 02.01.2002
- etc.
- If the browser locale can not be determined, then use ISO 8601
in reply to: ↑ 49 Changed 6 months ago by anonymous
no, not at all! how can one set then the international standards, "en" as language, and iso as date format?
Replying to Everard Brown <everard@…>:
Wouldn't it be nice for the date-time to be displayed in the format derived from the locale of the browser. i.e. If the viewer is using:
- en-US they see 01/02/02
- en-GB they see 02/01/02
- de-DE they see 02.01.2002
- etc.
- If the browser locale can not be determined, then use ISO 8601
Changed 4 months ago by srevill@…
Bump.
Is there any chance of someone fixing this - sounds pretty trivial to me. The fact this has sat here festering for six months makes me feel like learning Python myself.
Changed 5 weeks ago by anonymous
This is exactly why in all our docs we use the format DD MMM YYYY : 04 May 2009
No matter what country you're in, you don't screw it up. Well assuming you can read, are on the same calendar system as the rest of the world, and know the (in this case) english 3 letter for the months. but you get the idea. A format string would be nice. additionally, a short-form string should be considered, and also if you want the short-form/long form on hover type behavior in tickets/timeline etc., or to force long form everywhere. etc.



