aboutsummaryrefslogtreecommitdiff
path: root/web/views.go
diff options
context:
space:
mode:
Diffstat (limited to 'web/views.go')
-rw-r--r--web/views.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/views.go b/web/views.go
index bfbfe09..5dfc0e6 100644
--- a/web/views.go
+++ b/web/views.go
@@ -437,7 +437,11 @@ func formatSpeed(metersPerSecond float64) string {
func formatDuration(seconds int64) string {
hours := seconds / 3600
minutes := (seconds % 3600) / 60
- return fmt.Sprintf("%dh %02dm", hours, minutes)
+ secondsOnly := seconds % 60
+ if hours > 0 {
+ return fmt.Sprintf("%dh %02dm %02ds", hours, minutes, secondsOnly)
+ }
+ return fmt.Sprintf("%dm %02ds", minutes, secondsOnly)
}
func formatElevation(meters float64) string {