Content deleted Content added
No edit summary |
No edit summary |
||
Line 23:
c1, c2, c3 = mw.ustring.match (mw.text.trim(frame.args[1]), pattern[1]); -- one or more captures set if source matches patterns[i][1])
if c1 then -- c1 always set on match
t = {
[pattern[2] or 'x'] = c1, -- fill the table of captures with the captures
Line 34 ⟶ 35:
if month then
local df = table.concat ({pattern[2],
-- if 'dmy' == pattern[5] then -- for dmy dates▼
if 'dmy' == df then -- for dmy dates
return table.concat ({day, month, year}, ' '); -- assemble an English language dmy date
elseif 'my' == df then -- for month year dates▼
return table.concat ({month, year}, ' '); -- assemble an English language dmy date
return string.format ('%s %s, %s', month, day, year); -- assemble an English language mdy date
return month; -- none of the above, return the translated month;
end
end
|