Compare commits
1 Commits
80fa8d8294
...
10efec4733
| Author | SHA1 | Date | |
|---|---|---|---|
| 10efec4733 |
@@ -9,12 +9,11 @@ import java.util.Date
|
|||||||
class DateUtils {
|
class DateUtils {
|
||||||
companion object {
|
companion object {
|
||||||
/**
|
/**
|
||||||
* Format time duration in seconds as e.g. "2 hours, 1 min", rounded to minutes.
|
* Format time duration in seconds as e.g. "2 hours, 1 min", rounded up to minutes.
|
||||||
* Used for the duration to the next/previous event in the event details dialog.
|
* Used for the duration to the next/previous event in the event details dialog.
|
||||||
*/
|
*/
|
||||||
fun formatTimeDuration(context: Context, secondsDiff: Long): String {
|
fun formatTimeDuration(context: Context, secondsDiff: Long): String {
|
||||||
val adjusted = (secondsDiff + 30) - (secondsDiff + 30) % 60
|
return formatTimeDurationExact(context, 60L + secondsDiff - (secondsDiff % 60L))
|
||||||
return formatTimeDurationExact(context, adjusted)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun formatTimeDurationExact(context: Context, secondsDiff: Long): String {
|
fun formatTimeDurationExact(context: Context, secondsDiff: Long): String {
|
||||||
|
|||||||
Reference in New Issue
Block a user