Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ class RecordViewDataMapper @Inject constructor(
timeEnded: Long,
showSeconds: Boolean,
): Long {
return if (showSeconds) {
timeEnded - timeStarted
} else {
timeEnded.dropSeconds() - timeStarted.dropSeconds()
var delta: Long = timeEnded - timeStarted
if (!showSeconds && delta >= 60000L) {
// If we don't want seconds, return duration without taking them into account.
// However, if the result would be "0 minute", don't round the duration.
delta = timeEnded.dropSeconds() - timeStarted.dropSeconds()
}
return delta
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ class TimeMapper @Inject constructor(
val willShowMinutes: Boolean
val willShowSeconds: Boolean

if (forceSeconds) {
if (forceSeconds || (hr == 0L && min == 0L)) {
willShowHours = hr != 0L
willShowMinutes = willShowHours || min != 0L
willShowSeconds = true
Expand Down