Module:Sandbox/Martin Urbanec

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 .. " Day = " .. day .. " 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 .. " Day = " .. day .. " 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. " return msg end

return p