Module:Sandbox/Boboquack/Dates: Difference between revisions

Content deleted Content added
Boboquack (talk | contribs)
No edit summary
Boboquack (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 97:
--fifth try: parse as year
if string.match(indate,"(%d+)%D*[^% %d]+%D*(%d+)") then return "Invalid entry" end
local num0=string.match("A"..indate,".*%D(%d+)")
if p.valid(nil,nil,num0) then year,inform=num0,"year" else
return "Invalid entry"
Line 104:
--get era
if string.find(indate,"BCBCE") then era=" BCBCE"
elseif string.find(indate,"BCEBC") then era=" BCEBC"
elseif string.find(indate,"CE") then era=" CE"
elseif string.find(indate,"AD") then era=" AD"
Line 111:
--get uncertainty
if string.match(indate,"around") then circa="circa " elseif
elseif string.match(indate,"uncertain") then circa="circa " elseif
elseif string.match(indate,"about") then circa="circa " elseif
elseif string.match(indate,"approx") then circa="circa " elseif
elseif string.match(indate,"circa") then circa="circa " elseif
elseif string.match(indate,"ca%.") then circa="circa " else
else circa="" end
--convert output date to input format -> outdate