local p = -- p stands for package
function p.dmy(frame) local n = 0 local s = frame.args.text local txt = "" local sec = "" local word = 0 local BA = frame.args.BA or "" local form = frame.args.form or "iso" if BA~= "" then BA = " " .. BA end while n<=#s do n = n + 1 if string.match(string.sub(s,n,n),"%d")~=nil or string.match(string.sub(s,n,n),"%a")~=nil then sec = sec .. string.sub(s,n,n) else word = word + 1 if tonumber(sec)
nil then if sec
"February" then if not month then month = "2" end txt = txt .. "2 <-Month
" end if sec
"April" then if not month then month = "4" end txt = txt .. "4 <-Month
" end if sec
"June" then if not month then month = "6" end txt = txt .. "6 <-Month
" end if sec
"August" then if not month then month = "8" end txt = txt .. "8 <-Month
" end if sec
"October" then if not month then month = "10" end txt = txt .. "10 <-Month
" end if sec
"December" then if not month then month = "12" end txt = txt .. "12 <-Month
" end if sec~="January" and sec~="February" and sec~="March" and sec~="April" and sec~="May" and sec~="June" and sec~="July" and sec~="August" and sec~="September" and sec~="October" and sec~="November" and sec~="December" then txt = txt .. sec .. "
" end end if tonumber(sec)~=nil then if tonumber(sec)<=31 then if not num then num = sec end txt = txt .. sec .. " <-Number
" end if tonumber(sec)>31 then if not yr then yr = sec end txt = txt .. sec .. " <-Year
" end end if tonumber(sec)
nil and tonumber(string.sub(sec,1,#sec-2)) ~= nil and tonumber(string.sub(sec,1,#sec-2))>31 then txt = txt .. sec .. "
" end sec = "" end end txt = txt .. sec if num
"4" or "6" or "9" or "11" then num = 1 month = month+1 end if month
"dmy" then if month
"2" then month = "February" end if month
"4" then month = "April" end if month
"6" then month = "June" end if month
"8" then month = "August" end if month
"10" then month = "October" end if month
"12" then month = "December" end txt = txt .. num .. "-" .. month .. "-" .. yr .. BA .. "
" end if form
"1" then month = "January" end if month
"3" then month = "March" end if month
"5" then month = "May" end if month
"7" then month = "July" end if month
"9" then month = "September" end if month
"11" then month = "November" end if month
"y" then txt = txt .. yr .. BA .. "
" end if form
return p