Module:තිථි මං සළකුණු
This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
මෙම මොඩියුලය මතු දැක්වෙන මොඩියුල මත යැපෙයි: |
{{තිථි මං සළකුණු}} සඳහා අවශ්ය මොඩියුලය.
භාවිතය සංස්කරණය
{{#invoke:තිථි මං සළකුණු|function_name}}
local getArgs = require('Module:Arguments').getArgs
local p = {}
local maasa = mw.loadData("Module:තිථි මං සළකුණු/දත්ත").maasa
local function succession(frame, args)
local bef = args["පෙර"]
local aft = args["පසු"]
local title = args["තිථිය"]
local idxM = 0
local valM = ""
if title == nil then
title = mw.title.getCurrentTitle()
end
if bef == nil then
bef = "බක් අව තෙළෙස්වක"
end
if aft == nil then
aft = "බක් අමාවක"
end
local s = title.text
local items = mw.text.split( s, "%s+" )
for k, v in pairs( maasa ) do
-- process each key-value pair
if items[1] == v then
idxM = k
valM = v
break
end
end
-- for k, v in pairs( items ) do
-- -- process each key-value pair
-- return v
-- end
-- local retVal = frame:expandTemplate("තිථි මං සළකුණු/පෙර-පසු-තිථි")
local retVal = frame:expandTemplate{ title = 'තිථි මං සළකුණු/පෙර-පසු-තිථි', args = { bef, aft } }
return retVal
end
function p.main(frame)
local args = getArgs(frame)
return p._main(frame, args)
end
function p._main(frame, args)
return succession(frame, args)
end
return p