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

יצירת דף עם התוכן "mtable = {"ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמב..."
עדיין בעבודה
שורה 47: שורה 47:
end
end
return ans
return ans
end
function allmonths(hyear)
return math.floor((hyear - 9) * 235 / 19) + 87
end
function molad(months)
local A
A.allparts = months * 765433 + 170640
A.days = math.floor(A.allparts / 25920)
A.day = A.days % 7
A.hour = math.floor(A.allparts / 1080 % 24)
A.part = A.allparts % 1080
A.parts = A.allparts % 25920
return A
end
function metonic(hyear)
return (x * 12 + 5) % 19
end
function dehiyot(hyear)
local heshbon = molad(allmonths(hyear))
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))
then roshana = roshana + 1
end
if ((roshana * 3 + 1) % 7 > 3)
then roshana = roshana + 1
end
return roshana
end
function kviut(hyear)
local thisyear = dehiyot(hyear)
local yearlength = dehiyot(hyear + 1) - thisyear
local hasiman
end
end