Opened 9 years ago

Closed 9 years ago

#2149 closed enhancement (fixed)

Use predefined date format for macro arguments

Reported by: nic@… Owned by: mape
Priority: normal Component: TimeVisualizerPlugin
Severity: normal Keywords:
Cc: th07@… Trac Release: 0.10


I have a european date format set and so get the following error:

Traceback (most recent call last):

File "/usr/lib/python2.3/site-packages/trac/web/", line 406, in dispatch_request


File "/usr/lib/python2.3/site-packages/trac/web/", line 237, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/tractimevisualizerplugin/", line 31, in process_request File "build/bdist.linux-x86_64/egg/tractimevisualizerplugin/", line 326, in process_request File "build/bdist.linux-x86_64/egg/tractimevisualizerplugin/", line 56, in build_svg

Exception: invalid startdate: '08/8/07', expected format: 'YYYY-MM-DD'

Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by mape

  • Cc th07@… added; anonymous removed

Thanks for this report, I'm gonna check this when I have spare time...

comment:2 Changed 9 years ago by mape

I'm not avare about the use case where you encounter to this issue. I expect that you tried the macro somehow as follows:


Implementation uses Trac code base to parse the passed time timevisualizerplugin/0.10/tractimevisualizerplugin/

You should recover from this issue by using macro as follows:


As a side node, I don't know, where from Trac identifies, which format to use. I expect that user agent gives the hint. If so, then this comes to real i18n issue, thus others use ur ISO format, others have their own locale settings. The solution would be to force macro to certain format (my choice would be ur ISO format).

Meanwhile, please let me know if my proposal above did help.

comment:3 Changed 9 years ago by mape

  • Status changed from new to assigned
  • Summary changed from European date format breaks implementation to Use predefined date format for macro arguments
  • Type changed from defect to enhancement

It really makes sense to use pre-defined format rather than user specific, which just doesn't work in global world. I think that best way is to let user to specify format in Trac config. It would makes sense to let user to override format with macro parameter.

As a noob Python developer, I need to find implementation similar to Javas SimpleDateFormat. Any ideas / PoC patches are welcome.


comment:4 Changed 9 years ago by mape

I've now studied the topic and have PoC implementation (on my laptop) using ISO 8601 format. However, one has to write times in UTC-which might be quite difficult for many. Using other time zone would be possible, but then full form would be needed, e.g. "2007-12-23T00:00:00+02:00"... I might consider implementing spec with exception, like this "2007-12-12Z+2". Then having one year burndown at my time zone, i would have times "2007Z+2" - "2008Z+2"

I still need to consider keeping plugin backward compatible, which requires some extra effort before I'll commit changes...

comment:5 Changed 9 years ago by mape

  • Resolution set to fixed
  • Status changed from assigned to closed

0.6 version ([3276]) implements ISO 8601 format.

Add Comment

Modify Ticket

as closed The owner will remain mape.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.