mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-11 14:49:24 +02:00
More elegant solution for more use-cases
Filter_time will return input table if filtered table would have been empty, should fix bugs
This commit is contained in:
parent
ba75b9741e
commit
21d33afaaf
@ -105,6 +105,9 @@ function Public.filter_time(fancy_array, filter_words, mode)
|
||||
end
|
||||
end
|
||||
end
|
||||
if #filtered_array == 0 then
|
||||
filtered_array = fancy_array
|
||||
end
|
||||
return filtered_array
|
||||
end
|
||||
|
||||
@ -124,9 +127,7 @@ end
|
||||
---@param seconds <number>
|
||||
function Public.short_fancy_time(seconds)
|
||||
local fancy = Public.seconds_to_fancy(seconds,true)
|
||||
if seconds > 59 then
|
||||
fancy = Public.filter_time(fancy, {"seconds","s"}, false)
|
||||
end
|
||||
fancy = Public.filter_time(fancy, {"seconds","s"}, false)
|
||||
fancy = Public.fancy_time_formatting(fancy)
|
||||
return fancy
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user