26.11.2020, 17:27
(25.11.2020, 13:15)admin Wrote: I'm not sure that filtering function is correct, try replacing it with this:
Code:-- Check if all trends or selection neeed to be exported
if export_all == false then
tmp = {}
for _, t in ipairs(trends_table) do
for _, name in ipairs(trendnames) do
if name == t.name then
tmp[ #tmp + 1 ] = t
end
end
end
trends_table = tmp
end
-- Check if the is at least 1 trend to be exported
there is something wrong here:
Code:
for _, row in ipairs(trenddatamonth) do
stamp = dates['start'].year .. '-' .. dates['start'].month .. '-' .. string.format("%02d", _)
local y, m, d = stamp:match("(%d+)%-(%d+)%-(%d+)")
local t = { year = y, month = m, day = d}
n15 = tonumber (string.format("%02d", _))*60*15
modulo = n15*15
hours1 = string.format("%02.f", math.floor(n15/3600));
mins1 = string.format("%02.f", math.floor(n15/60 - (hours1*60)));
Ora = hours1..":"..mins1
-- format csv row
csv = string.format('%q,%q,%q', string.format("%02d", dates['start'].day) .. "-" .. string.format("%02d", dates['start'].month) .. "-" .. dates['start'].year, Ora, row)
-- add to buffer
table.insert(buffer, csv)
end
Because time are over the 24 hours: