Module:Calendar widget

This is an old revision of this page, as edited by RexxS (talk | contribs) at 14:18, 29 June 2019 (default to nil). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

--[[
Module to create Calendar widget

--]]

local p = {}

local function isleap(year)
	year = tonumber(year) or 1
	return year % 4 == 0
	and year % 100 ~= 0
	or year % 1000 == 0
end


--[[
isleap returns "leap" if passed a leap year
otherwise returns nothing
]]
function p.isleap(frame)
	if isleap(frame.args[1]) then return "leap" end
	return nil
end


return p