comparison mod_http_muc_log/mod_http_muc_log.lua @ 2837:bd5eb429ebab

mod_http_muc_log: Round down timestamps to midnight in order to fix an off by one issue (thanks asterix)
author Kim Alvefur <zash@zash.se>
date Sat, 18 Nov 2017 20:39:31 +0100
parents 52a7c0f6aea1
children 5125e187768f
comparison
equal deleted inserted replaced
2836:52a7c0f6aea1 2837:bd5eb429ebab
101 end 101 end
102 elseif lazy then 102 elseif lazy then
103 -- Lazy with many false positives 103 -- Lazy with many false positives
104 local first_day = find_once(room, nil, 3); 104 local first_day = find_once(room, nil, 3);
105 local last_day = find_once(room, { reverse = true }, 3); 105 local last_day = find_once(room, { reverse = true }, 3);
106 first_day = date_floor(first_day);
107 last_day = date_floor(last_day);
106 for when = first_day, last_day, 86400 do 108 for when = first_day, last_day, 86400 do
107 local t = os_date("!*t", when); 109 local t = os_date("!*t", when);
108 dates:set(t.year, t.month, t.day, when ); 110 dates:set(t.year, t.month, t.day, when );
109 end 111 end
110 else 112 else