mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Improve timeseries charts
This commit is contained in:
parent
c7b87deec9
commit
9b75e6e834
4 changed files with 26 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue