Modify

Opened 4 years ago

Last modified 4 years ago

#7101 new enhancement

Support localised date formats

Reported by: willholley@… Owned by: rjollos
Priority: normal Component: PlannedMilestonesMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

would be nice if it supported UK date formats (or the ability to specify a format string as a parameter to the macro)

Attachments (1)

datefield_settings.png (25.6 KB) - added by dnedelchev 4 years ago.
See fields 'format' (values: dmy, mdy, ymd) and 'separator' (from DateField Plugin's Options)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by rjollos

I imagine that there is a Python package that would make this easy to implement, but I'd have to do some research. Please let me know if you know of an easy way to implement ...

comment:2 Changed 4 years ago by willholley

I had a quick look yesterday but ended up just hacking the macro to format the dates in uk format. I'd expect trac to have some system setting for the default date format somewhere?

comment:4 Changed 4 years ago by rjollos

Replying to willholley:

I had a quick look yesterday but ended up just hacking the macro to format the dates in uk format. I'd expect trac to have some system setting for the default date format somewhere?

If such a preference existed, it would probably be listed here, but I don't see it listed.

What does a UK date format look like? I'd thought YYYY-MM-DD to be universally accepted.

A preference might be useful because it could be used in places such as the timeline and roadmap, but you'd have to request an enhancement to Trac, and then the PlannedMilestonesMacro could be modified once the API functionality was made available.

comment:5 Changed 4 years ago by anonymous

We would normally expect dates in the format DD-MM-YYYY. I'll investigate further with trac directly about a preference...

Changed 4 years ago by dnedelchev

See fields 'format' (values: dmy, mdy, ymd) and 'separator' (from DateField Plugin's Options)

comment:6 Changed 4 years ago by dnedelchev

You can see how it's implemented in DateFieldPlugin (I've attached a screenshot too).

However IMHO it would be definitely best if it was an global trac-environment-level option instead of a set of individual plugins' date-format settings.
If there was a global TracDateFormat setting then any reated hack/plugin whould account for it. (It implies creating an enhancement request for Trac of course if there is no such already)

For example I whould like to use YYYY-MM-DD format everywhere, but for the Milestone view it seems the server default format is used (I think so since I have YYYY-MM-DD on my WinXP-hosted test environments and MM/DD/YYYY on our linux-hosted production environments. I think no one wants to get mixed date formats in a single environment.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.