Module:Sandbox/CanonNi

This is an old revision of this page, as edited by CanonNi (talk | contribs) at 07:11, 2 November 2024 (making day global). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local Date = require('Module:Date')._Date
local current = require('Module:Date')._current

local p = {}

function p.main(frame)
	local day
	
	if frame.args[1] ~= nil then
		day = Date(frame.args[1]):text('dmy')
	else
		day = Date(current.year, current.month, current.day):text('dmy')
	end
	
	return ": ''As of " .. day .. (frame.args[2] or '')
end

return p