יחידה:תאריך עברי: הבדלים בין גרסאות בדף
משתמש:IKhitron/טיוטה |
אין תקציר עריכה |
||
| שורה 241: | שורה 241: | ||
end | end | ||
function | function fromhebrew1() | ||
local rem = mw.text.trim(remove( | local rem = mw.text.trim(remove(frame.args[1])) | ||
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 | return ifwhich(fromhebrewmonth(rem)) end | ||
end | end | ||
if rem == "ה' אלפים" then if frame.args["exact"] ~= "כן" | |||
then return ifwhich("1239-1240") else return ifwhich(1240) end end -- here | |||
if find1(rem, " ") == 0 then | if find1(rem, " ") == 0 then | ||
return | return ifwhich(fromhebrewyear(rem)) end | ||
return ifwhich(fromhebrewdate(rem, to)) | |||
end | end | ||
| שורה 279: | שורה 264: | ||
which = false | which = false | ||
return fromhebrewandverify(f) | return fromhebrewandverify(f) | ||
end | end | ||
function fromhebrewandverify(f) | function fromhebrewandverify(f) | ||
frame = f | frame = f | ||
if frame.args["about"] == "כן" and | if frame.args["about"] == "כן" and | ||
frame:expandTemplate({title = "גיל לערכי אישים/מקורב", args = {str = frame.args[1]}}) ~= "" | |||
then return ifwhich(frame.args[1], "[[קטגוריה:דפים עם תאריך עברי מקורב]]") end | then return ifwhich(frame.args[1], "[[קטגוריה:דפים עם תאריך עברי מקורב]]") end | ||
local success, res = pcall(fromhebrew1) | local success, res = pcall(fromhebrew1) | ||
| שורה 343: | שורה 325: | ||
function findwdatetype(wdate) | function findwdatetype(wdate) | ||
local rem = mw.text.trim(remove(wdate)) | local rem = mw.text.trim(remove(wdate)) | ||
if find1(rem, "-") ~= 0 then | |||
return "num", rem end | |||
if find1(rem, "-") ~= 0 | |||
for m, mm in pairs(mtable) do | for m, mm in pairs(mtable) do | ||
if find1(rem, mm) == 1 | if find1(rem, mm) == 1 then | ||
return "my", rem end | |||
end | end | ||
if tonumber(rem) ~= nil and tonumber(rem) .. "" == rem then | if tonumber(rem) ~= nil and tonumber(rem) .. "" == rem then | ||