I would argue that this should be a method, Ryan's patch is actually a more accurate implementation of the current method. The current version should really be called something like approximate_time_in_words. However, it would be unrealistic to do that. I do think perhaps "exact_time_in_words" (or something similar) would be a good place for Ryan's method to exist. I think if people had it available, more would certainly use it. As it is now, most people don't think too much about it.
-- Brian Dear On Friday, August 7, 2009 at 8:46:08 AM UTC+2, Ryan Bigg wrote: > > This is why I gave you :except options, so you can get 2 years, 6 months, > for example. > > 2009/8/7 Jason King <[email protected] <javascript:>> > >> >> I wouldn't mind "about 2 and a half years" for the example in Ryan's >> original, For the record, I can't think of any time I'd want "2 >> years, 5 months, 3 days, 4 hours, 6 minutes and 42 seconds" - sorry. >> >> >> On Aug 6, 2009, at 10:48 PM, Michael Koziarski wrote: >> >> > >> > On Fri, Aug 7, 2009 at 5:44 PM, Ryan Bigg >> > (Radar)<[email protected] <javascript:>> wrote: >> >> Recently a lot of people I've spoken with have expressed that >> >> distance_of_time_in_words sucks for accuracy, providing values such >> >> as >> >> "about 2 years" where "2 years, 5 months, 3 days, 4 hours, 6 >> >> minutes and 42 >> >> seconds" is "more appropriate". To fix this, I've written a plugin: >> >> http://github.com/radar/dotiw. I'm thinking that this should be in >> >> Rails >> >> core as it is a vast improvement over what currently exists, but I >> >> don't >> >> want to put the effort into a patch that's just going to be >> >> rejected, as per >> >> usual. >> >> Who else would find this useful? >> > >> > The whole purpose of the existing method is to provide an approximate >> > value, if that's not what you're looking for then you shouldn't be >> > calling that method :) >> > >> > Given that your plugin is completely stand alone and doesn't need to >> > override anything messy to keep functioning, I don't think we need to >> > make the change unless millions of people are clamouring for it. Not >> > to pre-judge but this is the first time I've heard this asked for, so >> > I'm thinking we'll be best off leaving things as they are. >> > >> >> -- >> >> Ryan Bigg >> >> >> >>> >> >> >> > >> > >> > >> > -- >> > Cheers >> > >> > Koz >> > >> > > >> >> >> >> > > > -- > Ryan Bigg > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
