יחידה:תאריך עברי: הבדלים בין גרסאות בדף
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 272: | שורה 272: | ||
if noth(frame.args[1]) then return "" end | if noth(frame.args[1]) then return "" end | ||
which = false | which = false | ||
local success, res = pcall(pick1, frame.args[1], frame.args[2], "[[קטגוריה:משהו]]") | |||
if not success | |||
then res = "" end | |||
local ans = "" | local ans = "" | ||
if f.args[2] ~= "" | if f.args[2] ~= "" | ||
| שורה 277: | שורה 280: | ||
if f.args[1] ~= "" | if f.args[1] ~= "" | ||
then ans = ans .. fromhebrewandverify(f) end | then ans = ans .. fromhebrewandverify(f) end | ||
return ans | return res .. ans | ||
end | end | ||
| שורה 369: | שורה 372: | ||
end | end | ||
function pick1(hdate, wdate) | function pick1(hdate, wdate, cat) | ||
local ht, hrem = findhdatetype(hdate) | local ht, wt, hrem, wrem, hdw, wdh, hsuccess, wsuccess | ||
if cat == nil | |||
then which = true | |||
ht, hrem = findhdatetype(hdate) | |||
wt, wrem = findwdatetype(wdate) | |||
else ht, hrem = pcall(findhdatetype, hdate) | |||
wt, wrem = pcall(findwdatetye, wdate) | |||
hsuccess = false | |||
wsuccess = false end | |||
if hrem == "" | if hrem == "" | ||
then ht = "empty" | then ht = "empty" | ||
| שורה 384: | שורה 392: | ||
if not wsuccess | if not wsuccess | ||
then wt = "about" end end | then wt = "about" end end | ||
if cat ~= nil | |||
then if ht and wt and hsuccess and wsuccess | |||
then return cat | |||
else return "" end end | |||
if hsuccess and wsuccess | if hsuccess and wsuccess | ||
then if ht == "dmy" then return hdw | then if ht == "dmy" then return hdw | ||
| שורה 395: | שורה 407: | ||
elseif ht == "about" then return hdate | elseif ht == "about" then return hdate | ||
else return wdate end | else return wdate end | ||
end | |||
function checkcat(adate, cat) | |||
if cat == nil | |||
then return adate end | |||
return cat | |||
end | end | ||