local p =
function p.dmyformat(frame) local dmydate, format = frame.args.dmydate or "", frame.args.format or "" local a = string.match(dmydate, "(%d+) %w+ %d+") or string.match(dmydate, "(%w+) %d+, %d+") or string.match(dmydate, "(%w+) %d+ %d+") or string.match(dmydate, "(%d+)/%d+/%d+") or string.match(dmydate, "(%d+)-%d+-%d+") or string.match(dmydate, "(%d+)%w+ %w+ %d+") or string.match(dmydate, "(%w+) %d+") or string.match(dmydate, "(%d+) %w+") or string.match(dmydate, "(%d+) %d+") or string.match(dmydate, "(%w+)") or string.match(dmydate, "(%d+) %w+ %w+") or string.match(dmydate, "(%d+)%w+ %u%w+ %d+") or "" local b = string.match(dmydate, "%d+ (%w+) %d+") or string.match(dmydate, "%w+ (%d+), %d+") or string.match(dmydate, "%w+ (%d+) %d+") or string.match(dmydate, "%d+/(%d+)/%d+") or string.match(dmydate, "%d+-(%d+)-%d+") or string.match(dmydate, "%d+%w+ (%w+) %d+") or string.match(dmydate, "%w+ (%d+)") or string.match(dmydate, "%d+ (%w+)") or string.match(dmydate, "%d+ (%d+)") or string.match(dmydate, "%d+%w+ (%u)(%w+) %d+") or "" local c = string.match(dmydate, "%d+ %w+ (%d+)") or string.match(dmydate, "%d+ %d+ (%d+)") or string.match(dmydate, "%w+ %d+, (%d+)") or string.match(dmydate, "%d+/%d+/(%d+)") or string.match(dmydate, "%d+-%d+-(%d+)") or string.match(dmydate, "%w+ %d+ (%d+)") or string.match(dmydate, "%d+%w+ %w+ (%d+)") or string.match(dmydate, "%d+%w+ %u%w+ (%d+)") or "" local d = string.match(dmydate, "%d+ %w+ %d+ (%a+)") or "" local e = string.match(dmydate, "(%d+)-(%d+)-(%d+)") or "" local f = string.match(dmydate, "(%w+) (%d+), (%d+)") or "" local g = string.match(dmydate, "(%d+)/(%d+)/(%d+)") or "" local h = string.match(dmydate, "(%d+) (%w+) (%d+)") or "" local i = string.match(dmydate, "(%d+)") or "" local j = string.match(dmydate, "(%d+) (%w+)") or "" local k = string.match(dmydate, "(%d+) (%d+)") or "" local l = string.match(dmydate, "(%d+)(%w+) (%w+) (%d+)") or "" local m = string.match(dmydate, "(%d+) (%w+) (%d+) (%w+)") or "" local n = string.match(dmydate, "(%w+) (%w+) (%w+) (%w+)") or "" local o = string.match(dmydate, "(%d+)%w+ (%u)(%w+) (%d+)") or "" local p = string.match(dmydate, "(%d+)%U+(%a+)%D+(%d+)") or "" local a2 = tonumber(a) or 0 local a3 = string.find(a, "%d+") or "" local a4 = string.find(a, "%d?") or "" local a5 = string.find(a, "%a+") or "" local b2 = tonumber(b) or 0 local b3 = string.find(b, "%a+") or "" local c2 = tonumber(c) or 0 local c3 = string.find(a, "%d+") or "" local day = "" local month = "" local year = "" if i ~= "" and a2>0 and a2>31 then year = a2 end if a2>0 and a4 ~= "" then day = a2 end if a5
c and a2>0 and a4 ~= "" then day = a2 month = b end if year
a2 then month = b year = c end if month
a2 and c
a2 and c
"" and d
"feb" and (year % 4
0 then days_in_month = 29 else days_in_month = 28 end if month
0) and (year % 100 ~= 0) or (year % 400)
"jan" or months
"mar" or months
"apr" or months
"may" or months
"jun" or months
"jul" or months
"aug" or months
"sep" or months
"oct" or months
"nov" or months
"dec" or months
"" and i ~= "" and j ~= "" and years ~= "" and m
"" and h ~= "" and j
"" and circa
"" and h
"" and m
"" and h ~= "" and format
"" and o
"" and h ~= "" then local no = string.format("%u %s %u", day, months, year) return "circa".." "..no.."
" end if circa ~= "" and format
"year" and format ~= "" then local y = string.format("%u", year) return "circa".." "..y.."
" end if circa ~= "" and format
"" then local no = string.format("%u", year) return "circa".." "..no.."
" end if circa ~="" and format
if format
"mdy" then local mdy = string.format("%s %u, %u", months, day, year) return mdy.."
" end if format
"year" then local y = string.format("%u", year) return y.."
" end if format
"" and k
"" and years ~= "" and m ~= "" then local no = string.format("%u %s %u %s", day, months, year, years) return no.."
" end if format
"" and c
"" and i ~= "" and c
0 and a2<31 then local no = string.format("%u", day) return no.."
" end if format
"" and k ~= "" and c
"" and a2>31 and i ~= "" and j~= "" then local no = string.format("%u", year) return no.."
" end if format
"" and b
"" and g ~= "" then local no = string.format("%u-%u-%u", year, monthnumber, day) return no.."
" end if format
"" and e ~= "" then local no = string.format("%u-%u-%u", year, monthnumber, day) return no.."
" end if format
return p