mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-22 04:12:19 +00:00
Fixed util.getTimeFromString not processing a single number as seconds
This commit is contained in:
parent
adb469a29f
commit
14ebac44d9
1 changed files with 5 additions and 3 deletions
|
@ -139,6 +139,8 @@ function util.getAreaName(areaId)
|
|||
end
|
||||
|
||||
function util.getTimeFromString(str)
|
||||
if tonumber(str) then return tonumber(str) end
|
||||
|
||||
local amount, unit = string.match(str, "^([0-9]+)([smhdwy])$")
|
||||
|
||||
if not (amount and unit) then return nil end
|
||||
|
|
Loading…
Reference in a new issue