יחידה:תאריך עברי: הבדלים בין גרסאות בדף

אין תקציר עריכה
אין תקציר עריכה
שורה 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


שורה 370: שורה 373:


function pick1(hdate, wdate, cat)
function pick1(hdate, wdate, cat)
local ht, hrem = findhdatetype(hdate)
local ht, hrem
local wt, wrem = findwdatetype(wdate)
local wt, wrem
local hsuccess, hdw, wsuccess, wdh
if cat == nil
which = true
then ht, hrem = findhdatetype(hdate)
wt, wrem = findwdatetype(wdate)
else ht, hrem = pcall(findhdatetype, hdate)
wt, wrem = pcall(findwdatetye, wdate) end
local hsuccess = false
local wsuccess = false
local hdw, wdh
if hrem == ""
if hrem == ""
then ht = "empty"
then ht = "empty"
שורה 384: שורה 393:
if not wsuccess
if not wsuccess
then wt = "about" end end
then wt = "about" end end
hdate = checkcat(hrem, cat)
if cat ~= nil
hdw = checkcat(hdw, cat)
then if ht and wt and hsuccess and wsuccess
wdate = checkcat(wrem, cat)
then return cat
wdh = checkcat(wdh, 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