Skip to content

Commit e2229ea

Browse files
Merge pull request #768 from Skgland/more-time-units
show time spans longer than 2.5 days in days
2 parents a6b847b + 6d69f57 commit e2229ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/server/routes/ui/experiments.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ fn humanize(duration: Duration) -> String {
139139
format!("{duration:?}")
140140
} else if duration.as_secs() < 60 * 60 {
141141
format!("{} minutes", duration.as_secs() / 60)
142-
} else {
142+
} else if duration.as_secs() < 60 * 60 * 60 {
143143
format!("{:.1} hours", duration.as_secs_f64() / 60.0 / 60.0)
144+
} else {
145+
format!("{:.1} days", duration.as_secs_f64() / 60.0 / 60.0 / 24.0)
144146
}
145147
}
146148

0 commit comments

Comments
 (0)