Improve timeseries charts

This commit is contained in:
emanuele-f 2018-11-06 10:42:56 +01:00
parent c7b87deec9
commit 9b75e6e834
4 changed files with 26 additions and 9 deletions

View file

@ -186,4 +186,16 @@ function format_utils.formatEpoch(epoch)
end
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)
local end_day = os.date("%d", epoch_end)
if begin_day == end_day then
return os.date("%X", epoch)
end
return format_utils.formatEpoch(epoch)
end
return format_utils