--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Mon May 06 16:05:00 2019 +0200
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Tue May 07 17:10:07 2019 +0200
@@ -109,16 +109,20 @@
local rev = query.reverse;
if query.start then
local d = dt.date(query.start);
- for i = 1, #dates do
- if dates[i] >= d then
+ for i = start_day, last_day, step do
+ if dates[i] < d then
+ start_day = i + 1;
+ elseif dates[i] >= d then
start_day = i; break;
end
end
end
if query["end"] then
local d = dt.date(query["end"]);
- for i = #dates, 1, -1 do
- if dates[i] <= d then
+ for i = last_day, start_day, -step do
+ if dates[i] > d then
+ last_day = i - 1;
+ elseif dates[i] <= d then
last_day = i; break;
end
end