From 52ef292e26354d2bef29385a2e74854600329f5c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 18 Dec 2024 17:51:17 +0000 Subject: [PATCH] Lua code format - (Stylua) --- data/libs/functions/game.lua | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/data/libs/functions/game.lua b/data/libs/functions/game.lua index a7af356859e..ad1dc6a9228 100644 --- a/data/libs/functions/game.lua +++ b/data/libs/functions/game.lua @@ -184,33 +184,33 @@ function Game.getPlayerAccountId(name) end function Game.getFormattedTimeRemaining(time) - local timeNow = os.time() - local timeRemaining = time - timeNow - local days = math.floor(timeRemaining / 86400) - local output = "" - - if days > 1 then - return days .. " days" - end - - local hours = math.floor((timeRemaining % 86400) / 3600) - local minutes = math.floor((timeRemaining % 3600) / 60) - local seconds = timeRemaining % 60 - - if hours == 0 and minutes == 0 and seconds > 0 then - output = "less than 1 minute" - else - if hours > 0 then - output = output .. hours .. " hour" .. (hours ~= 1 and "s" or "") - end - - if minutes > 0 then - if hours > 0 then - output = output .. " and " - end - - output = output .. minutes .. " minute" .. (minutes ~= 1 and "s" or "") - end - end - return output + local timeNow = os.time() + local timeRemaining = time - timeNow + local days = math.floor(timeRemaining / 86400) + local output = "" + + if days > 1 then + return days .. " days" + end + + local hours = math.floor((timeRemaining % 86400) / 3600) + local minutes = math.floor((timeRemaining % 3600) / 60) + local seconds = timeRemaining % 60 + + if hours == 0 and minutes == 0 and seconds > 0 then + output = "less than 1 minute" + else + if hours > 0 then + output = output .. hours .. " hour" .. (hours ~= 1 and "s" or "") + end + + if minutes > 0 then + if hours > 0 then + output = output .. " and " + end + + output = output .. minutes .. " minute" .. (minutes ~= 1 and "s" or "") + end + end + return output end