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

אין תקציר עריכה
אין תקציר עריכה
שורה 220: שורה 220:
for m, mm in pairs(monthtable) do
for m, mm in pairs(monthtable) do
if find1(rem, m) == 1 then
if find1(rem, m) == 1 then
return fromhebrewmonth(rem) end
return ifwhich(fromhebrewmonth(rem)) end
end
end
if find1(rem, " ") == 0 then
if find1(rem, " ") == 0 then
return fromhebrewyear(rem) end
return ifwhich(fromhebrewyear(rem)) end
return fromhebrewdate(rem, to)
return ifwhich(fromhebrewdate(rem, to))
end
end


function fromhebrew(f)
function fromhebrew(f)
which = true
return fromhebrewandverify(f)
end
function verify(f)
which = false
return fromhebrewandverify(f)
end
function fromhebrewandverify(f)
frame = f
frame = f
if frame.args["about"] == "כן"
if frame.args["about"] == "כן"
then
then for e, ee in pairs(abouttable) do
for e, ee in pairs(abouttable) do
if find1(frame.args[1], ee) > 0 then
if find1(frame.args[1], ee) > 0 then
return frame.args[1] end
return ifwhich(frame.args[1]) end
end end
end end
local success, res = pcall(fromhebrew1)
local success, res = pcall(fromhebrew1)
if success
if success
then return res
then return ifwhich(res)
elseif frame.args["error"] == nil
elseif frame.args["error"] == nil
then return aserror(res) end
then return aserror(res) end
שורה 304: שורה 313:
end
end


return {fromhebrew = fromhebrew, tohebrew = tohebrew}
function ifwhich(ans)
if which
then return ans
else return ""
end
end
 
return {fromhebrew = fromhebrew, tohebrew = tohebrew, verify = verify}