local p = require('strict')local Date = require('Module:Date')._Date
local function range(date) local date2 = date + 6 if date2:text("%Y") ~= date:text("%Y") then return date:text("%B %-d, %Y") .. " to " .. date2:text("%B %-d, %Y") elseif date2:text("%B") ~= date:text("%B") then return date:text("%B %-d") .. " to " .. date2:text("%B %-d, %Y") else return date:text("%B %-d") .. " to " .. date2:text("%-d, %Y") endend
local function line(date) local link = "" .. range .. "" return linkend
local function userLink(username) return string.format("%s", username, username)end
p.list = function(frame) local text = "This article has been viewed enough times in a single week to appear in the Top 25 Report"
frame = frame:getParent local args = frame.args local list =
local date local isUntil = false local errors =
for parameter, dateStr in pairs(frame.args) do dateStr = mw.text.trim(dateStr) if string.lower(dateStr)
"collapse" then -- Ignore the collapse parameter else local index = string.find(dateStr,'(',1,true) local place = "" if index then place = string.sub(dateStr,index+1,-2) dateStr = string.sub(dateStr,0,index-1) end local newDate = Date(dateStr) if newDate
if count
1 then list = " The week in which this happened: " .. list text = text .. "." text = text .. list elseif (args["collapse"]
nil and count >= 10)) then text = text .. " " .. tostring(count) .. " times." text = '
' .. text .. ' The weeks in which this happened:
'.. list .. '
' else list = " The weeks in which this happened: " .. list text = text .. " " .. tostring(count) .. " times." text = text .. list end
if mw.title.getCurrentTitle.namespace
end
p.header = function(frame) local text = frame:expandTemplate text = text .. "\n" if mw.title.getCurrentTitle.subpageText
\n' text = text .. "
\n"
local count = 0 for index, nameStr in pairs(frame.args) do if index ~= 1 then count = count + 1 end end
if count > 0 then text = text .. "Prepared with commentary by "
if count
2 then text = text .. userLink(frame.args[2]) .. " and " .. userLink(frame.args[3]) else local i = 2 while i <= count do text = text .. userLink(frame.args[i]) .. ", " i = i + 1 end text = text .. " and " .. userLink(frame.args[count+1]) end end
local key = " "
text = text .. "\n\nā December 2012 monthly report" else text = text .. range(date-7) .. "|Last week's report]]" end if mw.title.getCurrentTitle.subpageText ~= "Top 25 Report" then text = text .. " ā Next week's report ā" key = "Top 25 " .. date:text("%Y%m%d") end if mw.title.getCurrentTitle.namespace
return p