Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

#6457 closed defect (fixed)

Age field in revisions is too coarse

Reported by: jtiai <redetin@…> Owned by: Jonas Borgström
Priority: normal Milestone: 0.11
Component: general Version: 0.10.4
Severity: normal Keywords: consider
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

As date 2007-12-07 (ISO format date) I've two files commited in my repository. Both states age as "2 years" but closer inspection revealed that another was changed at 2005-07-13 and another 2006-05-30.

Error margin (almost 25%) is a bit too high considered that project itself is about 2 and half years old.

Attachments (0)

Change History (3)

comment:1 by sid, 16 years ago

Keywords: needinfo added

Just to clarify your request, are you asking for "Modified 2.5 years ago" or a decimal point for more information?

I like that dates/times are rounded to whole numbers. Quick and easy to visually scan. Approx age at that point is good enough for stuff we do.

comment:2 by Christian Boos, 16 years ago

Keywords: consider added; needinfo removed
Milestone: 0.11.1

I think he was requesting that we use the previous unit for a range of values a bit extended, e.g.

  • trac/util/datefmt.py

    diff --git a/trac/util/datefmt.py b/trac/util/datefmt.py
    a b def pretty_timedelta(time1, time2=None,  
    8585        return '%i second%s' % (age_s, age_s != 1 and 's' or '')
    8686    for u, unit, unit_plural in units:
    8787        r = float(age_s) / float(u)
    88         if r >= 0.9:
     88        if r >= 1.9:
    8989            r = int(round(r))
    9090            return '%d %s' % (r, r == 1 and unit or unit_plural)
    9191    return ''

This shows things like 23 months.

Note that the patch doesn't work for seconds though, at least it uncovered a bug in get_timeline_link.

I'm siding with sid against decimal output if that's what was actually requested, but I think showing 2 years only if the age is actually above 23 months is better.

comment:3 by Christian Boos, 16 years ago

Milestone: 0.11.10.11
Resolution: fixed
Status: newclosed

Above patch applied in r6658.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.