most of us are using rails's built in time_ago_in_words, Rick Olsan wrote a much better plugin to extend that use and gives much 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 just snap it out of:
- script/plugin install http://ar-code.svn.engineyard.com/plugins/relative_time_helpers
0 comments:
Post a Comment