Fixes nil epoch_begin (#6302)

This commit is contained in:
Matteo Biscosi 2022-02-14 10:31:44 +01:00
parent 92fb853c31
commit f89ae72426

View file

@ -247,11 +247,11 @@ end
-- shorten an epoch when there is a well defined interval
function format_utils.formatEpochShort(epoch_begin, epoch_end, epoch)
local begin_day = os.date("!%d", epoch_begin + getFrontendTzSeconds())
local end_day = os.date("!%d", epoch_end + getFrontendTzSeconds())
local begin_day = os.date("!%d", (epoch_begin or os.time()) + getFrontendTzSeconds())
local end_day = os.date("!%d", (epoch_end or os.time()) + getFrontendTzSeconds())
if begin_day == end_day then
return os.date("!%X", epoch + getFrontendTzSeconds())
return os.date("!%X", (epoch or os.time()) + getFrontendTzSeconds())
end
return format_utils.formatEpoch(epoch)