Ticket #4721 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

can't add hours via comments when the hour is singular ("1 hour")

Reported by: k0s Assigned to: k0s
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

For the TracHoursPlugin, you can add hours like:

i worked 7 hours

or

i worked 7.5 hours

or

i worked 1:30 hours

However, you cannot add singular hours:

i worked 1 hour

I punted on this b/c the regex is either more complicated or more than one pass is needed.

Attachments

Change History

03/07/09 00:38:05 changed by Merola64

If I understand the problem correctly, the regex needs to match <amount of time> hours as well as <amount of time> hour.

Currently the regex is:

hours_regex = '(([0-9]+(\.[0-9]+)?)|([0-9]+:[0-5][0-9])) *hours'

Changing it to this would (in additon to the existing matches) match "1 hour" (as well as "2 hour", "1:30 hour" and "7.5 hour"):

hours_regex = '(([0-9]+(\.[0-9]+)?)|([0-9]+:[0-5][0-9])) *hours?'

Unsure if it is that simple or if you are looking for something else :)

03/20/09 15:51:14 changed by k0s

  • status changed from new to assigned.

I feel better enforcing people to use "1 hours" for now instead of supporting "7 hour", etc.

03/20/09 17:00:28 changed by k0s

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [5379]) support for singular hours in comments ("1 hour"); fixes #4721, but note that the code is brittle


Add/Change #4721 (can't add hours via comments when the hour is singular ("1 hour"))




Change Properties
Action