https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AUpdatedModule:Updated - Revision history2025-05-25T10:17:40ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.2https://en.wikipedia.org/w/index.php?title=Module:Updated&diff=1254913521&oldid=prevCanonNi: copied from Module:Sandbox/CanonNi2024-11-02T08:36:50Z<p>copied from <a href="/wiki/Module:Sandbox/CanonNi" title="Module:Sandbox/CanonNi">Module:Sandbox/CanonNi</a></p>
<p><b>New page</b></p><div>local Date = require('Module:Date')._Date<br />
local current = require('Module:Date')._current<br />
<br />
local p = {}<br />
<br />
function p.main(frame)<br />
local day<br />
<br />
if frame.args[1] then<br />
local success, result = pcall(function() return Date(frame.args[1]):text('dmy') end)<br />
if success then <br />
day = result<br />
else<br />
error('Invalid date format in Template:Update.')<br />
end<br />
else<br />
day = Date(current.year, current.month, current.day):text('dmy') + '[[Category:Pages using updated template with missing date]]'<br />
end<br />
<br />
--check for extra args<br />
local extra = ''<br />
if frame.args[3] and mw.title.getCurrentTitle() == 0 then<br />
extra = '[[Category:Pages using updated template with unknown parameters]]'<br />
end<br />
<br />
return string.format(": ''As of %s%s%s''", day, frame.args[2] or '', extra)<br />
end<br />
<br />
return p</div>CanonNi