Do not display 0 minute in the uptime if another period unit has value

This commit is contained in:
Erik C. Thauvin 2025-05-12 19:26:03 -07:00
parent 80d0960c4d
commit 5590cd007a
Signed by: erik
GPG key ID: 776702A6A2DA330E

View file

@ -596,10 +596,16 @@ public final class RenderUtils {
properties.getProperty("hours", " hours "))); properties.getProperty("hours", " hours ")));
} }
if (minutes == 0) {
if (years == 0 && months == 0 && weeks == 0 && days == 0 && hours == 0) {
sb.append(0).append(properties.getProperty("minute", " minute"));
}
} else {
sb.append(minutes).append(plural(minutes, properties.getProperty("minute", " minute"), sb.append(minutes).append(plural(minutes, properties.getProperty("minute", " minute"),
properties.getProperty("minutes", " minutes"))); properties.getProperty("minutes", " minutes")));
}
return sb.toString(); return sb.toString().trim();
} }
/** /**