Skip to content

Commit

Permalink
Fix desugaring
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Jan 7, 2022
1 parent f8c9969 commit fd6dd59
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ class FormatService(private val context: Context) {
includeSeconds: Boolean = false
): String {
val hours = duration.toHours()
val minutes = duration.toMinutesPart()
val seconds = duration.toSecondsPart()
val minutes = duration.toMinutes() % 60
val seconds = duration.seconds % 60

val h = context.getString(R.string.duration_hour_format, hours)
val m = context.getString(R.string.duration_minute_format, minutes)
Expand All @@ -293,7 +293,7 @@ class FormatService(private val context: Context) {
strs.add(m)
}

if (seconds > 0 && includeSeconds && (!short || (hours == 0L && minutes == 0))) {
if (seconds > 0 && includeSeconds && (!short || (hours == 0L && minutes == 0L))) {
strs.add(s)
}

Expand Down

0 comments on commit fd6dd59

Please sign in to comment.