Documentation for this module may be created at Module:Sandbox/Martin Urbanec/doc
local p = {};
p.test = function(frame)
local dmydate = frame.args.dmydate or ""
local month, day, year = string.match(dmydate, "(%w+) (%d+) %p (%d+)")
return "Year = " .. year .. "<br>Day = " .. day .. "<br>Month = " .. month
end
p.dateparsing = function(frame)
local dmydate = frame.args.dmydate or ""
local month, day, year = string.match(dmydate, "(%w+) (%d+), (%d+)")
return "Year = " .. year .. "<br>Day = " .. day .. "<br>Month = " .. month
end
p.temperature = function(frame)
cel = tonumber(frame.args.celsius) or 0
if cel >9 then msg = "It is warm." else msg = "It is cold." end
fah = cel*9/5+32
msg = msg .. " " .. cel .. " degrees Celsius is " .. fah .. " degrees Fahrenheit.<br>"
return msg
end
return p