2015-11-24 12:14 GMT-03:00 Skip Lentz <[email protected]>:
> Hi,
>
> I also had an idea for a method which returns the most significant unit of a 
> Duration.
>
> For example, you have a duration of 432 days, 3 hours, 21 minutes, 5 seconds, 
> etc., and
> it would return you "432 days" (or just “1 year”). I encountered this when 
> wanting to create
> a time indication on e.g. a commit or a comment. It’s much more readable and 
> user-friendly
> than a timestamp.
>
> Would this be a nice addition to the Duration API?

It would be nice to have. But why not something like a
DurationFormatter? that in turn collaborates with the Locale to ge the
words for "Year, Month, Week" in the current language.

Regards!

Reply via email to