Can I get actual date of update in addition to or instead of number of days?

Added by Wes Christensen over 6 years ago

When I open an issue, each update starts with a delimiter line that reports how many days ago the update was posted

    Updated by John Doe 8 days ago

Is there any way I can get something like

    Updated by John Doe 8 days ago, 08/15/11 10:14 AM

or

    Updated by John Doe on 08/15/11 10:14 AM, 8 days ago

Thanks

Replies (9)

RE: Can I get actual date of update in addition to or instead of number of days? - Added by Ivan Cenov over 6 years ago

You may put the mouse over "8 days ago" and a balloon will pop up that contains the exact date and hour.

RE: Can I get actual date of update in addition to or instead of number of days? - Added by Wes Christensen over 6 years ago

Yes, I did discover that. I meant to mention that in my post. That's certainly helpful, but I would really like to see it displayed. Apparently, there is no way to do that. Thanks.

RE: Can I get actual date of update in addition to or instead of number of days? - Added by Ivan Cenov over 6 years ago

I investigated for a while...

The code that displays the time stamp is in \path_to_redmine\app\views\issues\show.rhtml, lines 11-16. Methods 'authoring' and 'time_tag'. 'authoring' calls 'time_tag'. So, if the call of 'time_tag' is replaced by some other appropriate method this could achieved.

RE: Can I get actual date of update in addition to or instead of number of days? - Added by John Pels about 6 years ago

Just needed to do this myself, and tracked down where to change it.
I'm running v1.1.2.stable:

In /app/helpers/application_helper.rb, line 305


def time_tag(time)
- text = distance_of_time_in_words(Time.now, time)
+ text = "on #{format_time(time)}, #{distance_of_time_in_words(Time.now, time)}"

This will result in displaying your second choice, "Updated by John Doe on 8/15/2011 10:14AM, 8 days ago". Link and on hover balloon still present.

RE: Can I get actual date of update in addition to or instead of number of days? - Added by Chris Bellis over 5 years ago

I tried to apply this change to a Bitnami Redmine appliance running
Redmine version 2.0.2.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.5
Environment production
Database adapter MySQL

The authoring and time_tag methods appeared to be the same just at a different line number in the file specified above. I'm pretty green when it comes to Ruby and Rails, but could someone offer some tips?

Thanks

RE: Can I get actual date of update in addition to or instead of number of days? - Added by William Roush over 5 years ago

Chris Bellis wrote:

I tried to apply this change to a Bitnami Redmine appliance running
Redmine version 2.0.2.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.5
Environment production
Database adapter MySQL

The authoring and time_tag methods appeared to be the same just at a different line number in the file specified above. I'm pretty green when it comes to Ruby and Rails, but could someone offer some tips?

Thanks

That should be fine to edit, I don't think that part of the code has changed... worse that happens you'll roll back your changes. :)

RE: Can I get actual date of update in addition to or instead of number of days? - Added by Chris Bellis over 5 years ago

I am still getting the lines as:
"Added by project manager about 22 hours ago. Updated about 21 hours ago." Each update within the issue also has the Updated about XX hours/minutes ago.

The method now looks like this (from application_helper.rb):

def time_tag(time)

text = "on #{format_time(time)}, #{distance_of_time_in_words(Time.now, time)}"
if @project

link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)}, :title => format_time(time))

else

content_tag('acronym', text, :title => format_time(time))

end

end

I also tried rebooting the server and then without the quotes. Any suggestions?

RE: Can I get actual date of update in addition to or instead of number of days? - Added by Fred Giusto almost 5 years ago

I made this :

def time_tag(time)
text = distance_of_time_in_words(Time.now, time) + " (" + format_time(time) + ")"
if @project
link_to(text, {:controller => 'activities', :action => 'index', :id => @project, :from => User.current.time_to_date(time)}, :title => format_time(time))
else
content_tag('acronym', text, :title => format_time(time))
end
end

I have (in french) : il y a environ 3 mois (30/10/2012 14:52)

(1-9/9)