Skip to content

Commit

Permalink
fix: ban expiration in 0 hours (#869)
Browse files Browse the repository at this point in the history
* Fix for 0 hour ban expiration display bug

* Limit for maximum amount of units used
  • Loading branch information
gegelendvay committed Dec 30, 2023
1 parent b1a0049 commit 2caa4d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/webroutes/player/checkJoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ function checkBan(
if (ban.expiration) {
const humanizeOptions = {
language,
largest: 2,
round: true,
units: ['d', 'h'] as Unit[],
units: ['d', 'h', 'm'] as Unit[],
};
const duration = humanizeDuration((ban.expiration - ts) * 1000, humanizeOptions);
expLine = `<strong>${textKeys.label_expiration}:</strong> ${duration} <br>`;
Expand Down

0 comments on commit 2caa4d3

Please sign in to comment.