# HG changeset patch # User Waqas Hussain # Date 1311542500 -18000 # Node ID 99e7ef4fc7d20d9e2dcb17a54cd4f69983dd1d31 # Parent 8090d246c2680a3a7813809fe1c93abb127ee15b mod_muc_log_http: Properly sort calendar listing. diff -r 8090d246c268 -r 99e7ef4fc7d2 mod_muc_log_http/muc_log_http/mod_muc_log_http.lua --- a/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Mon Jul 25 02:21:40 2011 +0500 +++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Mon Jul 25 02:21:40 2011 +0500 @@ -298,7 +298,10 @@ if topic:len() > 135 then topic = topic:sub(1, topic:find(" ", 120)) .. " ..." end - for folder in lfs.dir(path) do + local folders = {}; + for folder in lfs.dir(path) do table.insert(folders, folder); end + table.sort(folders); + for _, folder in ipairs(folders) do local year, month, day = folder:match("^(%d%d)(%d%d)(%d%d)"); if year ~= nil and alreadyDoneYears[year] == nil then temptime.day = tonumber(day)