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

אין תקציר עריכה
אין תקציר עריכה
שורה 103: שורה 103:
function tomonth(gdate)
function tomonth(gdate)
return frame:callParserFunction("#זמןמ:F Y", gdate)
return frame:callParserFunction("#זמןמ:F Y", gdate)
end
function toonlymonth(gdate)
return frame:callParserFunction("#זמןמ:F", gdate)
end
end


שורה 204: שורה 208:


function fromhebrewmonth(hdate)
function fromhebrewmonth(hdate)
ans = fromhebrewdate('ט"ו ב' .. hdate, tomonth)
if frame.args["exact"] == "כן"
if frame.args["exact"] ~= "כן"
then return fromhebrewdate('ט"ו ב' .. hdate, tomonth) end
then ans = ans .. " בערך"
local date1 = fromhebrewdate("א' ב" .. hdate, same)
end
local month1 = toonlymonth(date1)
return ans
local year1 = toyear(date1)
local date2 = same(date1 .. " + 30 days")
date2 = frommonth(date2)
date2 = fromhebrewdate("א' ב" .. date2, same)
date2 = same(date2 .. " - 1 days")
local month2 = toonlymonth(date2)
local year2 = toyear(date2)
if year1 ~= year2
then return month1 .. " " .. year1 .. "-" .. month2 .. " " .. year2
elseif month1 ~= month2
then return month1 .. "-" .. month2 .. " " .. year1
else return month1 .. " " .. year1 end
end
end