Skip to content

Commit 6d69f57

Browse files
committed
show time spans longer than 2.5 days in days
1 parent 53fc2ea commit 6d69f57

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
@@ -138,8 +138,10 @@ fn humanize(duration: Duration) -> String {
138138
format!("{duration:?}")
139139
} else if duration.as_secs() < 60 * 60 {
140140
format!("{} minutes", duration.as_secs() / 60)
141-
} else {
141+
} else if duration.as_secs() < 60 * 60 * 60 {
142142
format!("{:.1} hours", duration.as_secs_f64() / 60.0 / 60.0)
143+
} else {
144+
format!("{:.1} days", duration.as_secs_f64() / 60.0 / 60.0 / 24.0)
143145
}
144146
}
145147

0 commit comments

Comments
 (0)