יחידה:תאריך עברי: הבדלים בין גרסאות בדף
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 271: | שורה 271: | ||
function verify(f) | function verify(f) | ||
if f.args[1] == "" | |||
then return "" end | |||
which = false | which = false | ||
return fromhebrewandverify(f) | |||
end | end | ||
| שורה 299: | שורה 295: | ||
then ans = ans .. "-" .. tohebrewnum("01-12-" .. gyear, fromyear) | then ans = ans .. "-" .. tohebrewnum("01-12-" .. gyear, fromyear) | ||
end | end | ||
return | return ans | ||
end | end | ||
| שורה 315: | שורה 311: | ||
local year2 = fromyear(date2) | local year2 = fromyear(date2) | ||
if year1 ~= year2 | if year1 ~= year2 | ||
then return | then return month1 .. " " .. year1 .. " - " .. month2 .. " " .. year2 | ||
elseif month1 ~= month2 | elseif month1 ~= month2 | ||
then return | then return month1 .. "-" .. month2 .. " " .. year1 | ||
else return | else return month1 .. " " .. year1 end | ||
end | end | ||
| שורה 327: | שורה 323: | ||
checkcasp(take) | checkcasp(take) | ||
take = same(take .. " + " .. diff(take) .. " days") | take = same(take .. " + " .. diff(take) .. " days") | ||
return | return format(take) | ||
end | end | ||
function tohebrewnum(wdate, format) | function tohebrewnum(wdate, format) | ||
if same(wdate) ~= wdate | if same(wdate) ~= wdate | ||
then error("wrong date") end | then error("wrong date") end | ||
checkcasp(wdate) | checkcasp(wdate) | ||
wdate = same(wdate .. " + " .. diff(wdate) .. " days") | wdate = same(wdate .. " + " .. diff(wdate) .. " days") | ||
return | return format(wdate) | ||
end | end | ||
| שורה 406: | שורה 400: | ||
end | end | ||
function | function tohebrew(f) | ||
local success, res = pcall(tohebrew1, | frame = f | ||
local success, res = pcall(tohebrew1, frame.args[1]) | |||
if success | if success | ||
then return res | then return res | ||
elseif frame.args["about"] == "כן" and | elseif frame.args["about"] == "כן" and | ||
frame:expandTemplate({title = "גיל לערכי אישים/מקורב", args = {str = | frame:expandTemplate({title = "גיל לערכי אישים/מקורב", args = {str = frame.args[1]}}) ~= "" | ||
then return | then return frame.args[1] | ||
elseif frame.args["error"] == nil | elseif frame.args["error"] == nil | ||
then return aserror(res) end | then return aserror(res) end | ||
return fixerror(frame.args["error"]) | return fixerror(frame.args["error"]) | ||
end | end | ||