Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow formatted durations to contain multiple time units #1

Open
seaneagan opened this issue Apr 5, 2013 · 0 comments
Open

Allow formatted durations to contain multiple time units #1

seaneagan opened this issue Apr 5, 2013 · 0 comments

Comments

@seaneagan
Copy link
Owner

Could allow DurationRounder.roundDuration to return a Map<TimeUnit, int> which could then mapped to a list of formatted Durations, sorted in descending order of TimeUnit, which can then be formatted using a CollectionFormat.

For example:

new Duration(seconds: 19,531)
// ->
{
TimeUnit.HOUR: 5,
TimeUnit.MINUTE: 25,
TimeUnit.MINUTE: 31
}
// ->
["5 hours", "25 minutes", "31 seconds"]
// ->
"5 hours, 25 minutes, and 31 seconds"

Are there any languages where this doesn't work?
Are there any languages where the order should be reversed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant