mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
AK: Don't show '0 seconds' unless seconds is the only available element
This commit is contained in:
parent
f33ea4aae4
commit
6ac71a6623
1 changed files with 2 additions and 1 deletions
|
@ -95,7 +95,8 @@ String human_readable_time(i64 time_in_seconds)
|
|||
if (minutes > 0)
|
||||
builder.appendff("{} minute{} ", minutes, minutes == 1 ? "" : "s");
|
||||
|
||||
builder.appendff("{} second{}", time_in_seconds, time_in_seconds == 1 ? "" : "s");
|
||||
if (time_in_seconds > 0 || days + hours + minutes == 0)
|
||||
builder.appendff("{} second{}", time_in_seconds, time_in_seconds == 1 ? "" : "s");
|
||||
|
||||
return MUST(builder.to_string());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue