Nov. 24, 2015
3:25 p.m.
2015-11-24 12:14 GMT-03:00 Skip Lentz <skip.lentz@inria.fr>:
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!