distance_of_time_in_words
August 7th, 2009 by RadarI was infatuated with this method when I first saw Rails but I’ve seen a couple of people recently express that Rails’ built in distanceoftimeinwords is not accurate enough, showing something like “about 2 years” rather than “2 years, 21 days, 5 hours, and 6 minutes”. With some help from chendo at Mocra (where I work) I’ve made a new distanceoftimeinwords which should be a drop-in replacement for the old crappy one. To install it, use: script/plugin install git://github.com/radar/dotiw.git. This also comes with another method if you’re still picky about the output: distanceoftimeinwords_hash which gives you a Hash containing keys in your native tongue. The README should give you a good guide of what other options it supports too.

August 10th, 2009 at 9:34 pm
[...] distanceoftimeinwords – This version by Ryan Bigg removes the vagueness in the Rails core version. [...]
August 28th, 2009 at 6:50 am
Awesome. Just what I needed, my site is charging based on time, and “about 2 hours ago” was not going to cut it.
thanks.