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

אין תקציר עריכה
אין תקציר עריכה
שורה 72: שורה 72:


function dehiyot(year)
function dehiyot(year)
local heshbon = molad(allmonths(year))
local heshbon = molad(tostring(allmonths(year)))
local roshana = heshbon.days
local roshana = heshbon.days
if (heshbon.hour > 17 or (heshbon.day == 3 and heshbon.parts > 9923 and metonic(year) > 6) or (heshbon.day == 2 and heshbon.parts > 16788 and metonic(year) > 11))
if (heshbon.hour > 17 or (heshbon.day == 3 and heshbon.parts > 9923 and metonic(year) > 6) or (heshbon.day == 2 and heshbon.parts > 16788 and metonic(year) > 11))
שורה 90: שורה 90:
local shana = tonumber(year)
local shana = tonumber(year)
local A
local A
A.thisyear = dehiyot(shana)
A.thisyear = dehiyot(year)
A.nextyear = dehiyot(shana + 1)
A.nextyear = dehiyot(tostring(shana + 1))
A.yearlength = A.nextyear - A.thisyear
A.yearlength = A.nextyear - A.thisyear
A.hasiman = otiyot[A.thisyear % 7] .. otiyot[A.yearlength % 10 + 3] .. otiyot[(A.nextyear - 2) % 7]
A.hasiman = otiyot[A.thisyear % 7] .. otiyot[A.yearlength % 10 + 3] .. otiyot[(A.nextyear - 2) % 7]