1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-01 13:08:05 +02:00

Fix nil bug - Fancy Time

Values below 60 seconds were returning nil in short_fancy_time()
Filter removed seconds, resulting values was empty (nil)
This commit is contained in:
Quadrum 2021-05-04 18:34:44 +02:00 committed by GitHub
parent dc7e594025
commit ba75b9741e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,9 @@ end
---@param seconds <number>
function Public.short_fancy_time(seconds)
local fancy = Public.seconds_to_fancy(seconds,true)
fancy = Public.filter_time(fancy, {"seconds","s"}, false)
if seconds > 59 then
fancy = Public.filter_time(fancy, {"seconds","s"}, false)
end
fancy = Public.fancy_time_formatting(fancy)
return fancy
end