X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Futils%2Fdatetime.js;h=49b70caf1116e0876e8c784084cc05510f95b93e;hp=00e8b4b9f4dfb7e55552ea418f6c95bf6c196d4d;hb=050ae3b58673dfa1ed41bf78d935fe95ec9e74c5;hpb=58e7b94e6e1a8d5721b9211b45c40e65fc13f600 diff --git a/client/src/utils/datetime.js b/client/src/utils/datetime.js index 00e8b4b9..49b70caf 100644 --- a/client/src/utils/datetime.js +++ b/client/src/utils/datetime.js @@ -33,11 +33,15 @@ export function ppt(t) let res = ""; if (days > 0) res += days + "d "; - if (days <= 3 && hours > 0) //TODO: 3 is arbitrary + if (days <= 3 && hours > 0) //NOTE: 3 is arbitrary res += hours + "h "; if (days == 0 && minutes > 0) res += (hours > 0 ? padDigits(minutes) + "m " : minutes + ":"); if (days == 0 && hours == 0) + { res += padDigits(seconds); + if (minutes == 0) + res += "s"; //seconds indicator, since this is the only number printed + } return res.trim(); //remove potential last space }