Open seaneagan opened 11 years ago
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?
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?