relative_time_helpers Plugin: time_ago_in_words on Steroids

Posted by Bhushan Ahire | Posted in Rails | Posted on 23-08-2007

0

From Basecamp's screenshot

relative_time_helpers is a straightforward, but very useful Rails plugin by Rick Olson that formats timestamps to human-friendly relative dates. You’re probably already using Rails’ built-in time_ago_in_words helper in your applications, but Rick’s relative_time gives even better results:

<%= relative_time(Time.now) %># today<%= relative_time(1.day.ago) %># yesterday<%= relative_time(1.day.from_now) %># tomorrow<%= relative_time_span([Time.now, 5.days.from_now]) %># May 17th - 22nd

To install it:

script/plugin install http://ar-code.svn.engineyard.com/plugins/relative_time_helpers