|
|
| (4 גרסאות ביניים של 2 משתמשים אינן מוצגות) |
| שורה 47: |
שורה 47: |
| end | | end |
| return ans | | return ans |
| end
| |
|
| |
| function allmonths(year)
| |
| local shana = tonumber(year)
| |
| return math.floor((shana - 9) * 235 / 19) + 87
| |
| end
| |
|
| |
| function molad(months)
| |
| local hodesh = tonumber(months)
| |
| local A
| |
| A.allparts = hodesh * 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(year)
| |
| local shana = tonumber(year)
| |
| return (shana * 12 + 5) % 19
| |
| end
| |
|
| |
| function dehiyot(year)
| |
| local heshbon = molad(allmonths(year))
| |
| 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
| |
|
| |
| otiyot = {
| |
| [0] = "ז", [1] = "א", [2] = "ב", [3] = "ג", [5] = "ה", [6] = "ח", [7] = "כ", [8] = "ש", [9] = "פ", [10] = "מ"
| |
| }
| |
|
| |
| function kviut(year)
| |
| local shana = tonumber(year)
| |
| local A
| |
| A.thisyear = dehiyot(shana)
| |
| A.nextyear = dehiyot(shana + 1)
| |
| A.yearlength = A.nextyear - A.thisyear
| |
| A.hasiman = otiyot[A.thisyear % 7] .. otiyot[A.yearlength % 10 + 3] .. otiyot[(A.nextyear - 2) % 7]
| |
| return A
| |
| end | | end |
|
| |
|
| שורה 660: |
שורה 612: |
|
| |
|
| return {fromhebrew = fromhebrew, tohebrew = tohebrew, verify = verify, pick = pick, samedate = samedate, | | return {fromhebrew = fromhebrew, tohebrew = tohebrew, verify = verify, pick = pick, samedate = samedate, |
| fromhebrewformat = fromhebrewformat, kviut = kviut} | | fromhebrewformat = fromhebrewformat} |