I’d find it extremely useful. The current implementation sucks, for various reasons.
Actually, what you expect when you use distance_of_time_in_words, and what arguably should be the default in rails, is for it to output precisely what you input.
The method is not called rounded_distance_of_time_in_words, after all.
What you would expect:
helper.distance_of_time_in_words(1.hour) => “1 hour” not “about 1 hour” which it currently does.
helper.distance_of_time_in_words(1.hour+ 15.minutes) => “1 hour and 15 minutes” or “one hour and a quarter.” and not “about 1 hour” which it currently does.
Fancy rounding of hours and days should be something extra, for the people that need that.
For everyone else, there should be sane defaults, namely a convention that doesn’t violate expectation.
You shouldn’t have to monkey-patch the app, or use an extra gem, to get the sane defaults.
Currently, this is how fancy it has become:
helper.distance_of_time_in_words(41.hours+ 59.minutes+29.seconds) => “1 day” eh… WTF? Since when did 1 day become 42 hours and not 24? Even according to the rounding principles used, this doesn’t make much sense.
Or these intervals:
1 yr <-> 1 yr, 3 months # => about 1 year
1 yr, 3 months <-> 1 yr, 9 months # => over 1 year
Who on earth would be able to deduce from the output that 1 year and 3 months is “about one year”, and not “over 1 year”?
See all the fancy roundings here in the docs, and see if you don’t agree with me.
Having the expected precision is especially important when using this in email communication towards users, or for communicating deadlines.
Precision doesn’t hurt, apart from being a bit UX unfriendly at times. On the other hand, imprecision and fancy roundings can be very damaging.
I vote that the relevant parts of the dotiw gem be made a part of core rails, since the default behavior should be intuitive and straightforward.