Modify

Opened 16 years ago

Closed 16 years ago

#4721 closed defect (fixed)

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

Reported by: Jeff Hammel Owned by: Jeff Hammel
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 (0)

Change History (3)

comment:1 Changed 16 years ago 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 :)

comment:2 Changed 16 years ago by Jeff Hammel

Status: newassigned

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

comment:3 Changed 16 years ago by Jeff Hammel

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeff Hammel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.