יחידה:תאריך עברי: הבדלים בין גרסאות בדף
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 50: | שורה 50: | ||
function allmonths(year) | function allmonths(year) | ||
local shana = math.floor(( | local shana = tonumber(year) | ||
return math.floor((shana - 9) * 235 / 19) + 87 | |||
end | end | ||
function molad(months) | function molad(months) | ||
local hodesh = months | local hodesh = tonumber(months) | ||
local A | local A | ||
A.allparts = hodesh * 765433 + 170640 | A.allparts = hodesh * 765433 + 170640 | ||
| שורה 67: | שורה 67: | ||
function metonic(year) | function metonic(year) | ||
local shana = year | local shana = tonumber(year) | ||
return (shana * 12 + 5) % 19 | |||
end | end | ||
function dehiyot( | function dehiyot(year) | ||
local heshbon = molad(allmonths( | local heshbon = molad(allmonths(year)) | ||
local roshana = heshbon.days | local roshana = heshbon.days | ||
if (heshbon.hour > 17 or (heshbon.day == 3 and heshbon.parts > 9923 and metonic(hyear) > 6) or (heshbon.day == 2 and heshbon.parts > 16788 and metonic(hyear) > 11)) | if (heshbon.hour > 17 or (heshbon.day == 3 and heshbon.parts > 9923 and metonic(hyear) > 6) or (heshbon.day == 2 and heshbon.parts > 16788 and metonic(hyear) > 11)) | ||
| שורה 89: | שורה 88: | ||
function kviut(year) | function kviut(year) | ||
local shana = year | local shana = tonumber(year) | ||
local A | local A | ||
A.thisyear = dehiyot(shana) | A.thisyear = dehiyot(shana) | ||