יחידה:תאריך עברי: הבדלים בין גרסאות בדף
יצירת דף עם התוכן "function sub1(str, from, to) return mw.ustring.sub(str, from, to) end function find1(str, what, ...) local args = ...; local where = 1; if (args ~= nil) the..." |
אין תקציר עריכה |
||
| שורה 21: | שורה 21: | ||
end | end | ||
return mw.ustring.len(s) | return mw.ustring.len(s) | ||
end | end | ||
function hebnum(s) | function hebnum(s) | ||
numberstable = { | |||
["א"] = 1, ["ב"] = 2, ["ג"] = 3, ["ד"] = 4, ["ה"] = 5, | |||
["ו"] = 6, ["ז"] = 7, ["ח"] = 8, ["ט"] = 9, ["י"] = 10, | |||
["כ"] = 20, ["ך"] = 20, ["ל"] = 30, ["מ"] = 40, ["ם"] = 40, | |||
["נ"] = 50, ["ן"] = 50, ["ס"] = 60, ["ע"] = 70, ["פ"] = 80, | |||
["ף"] = 80, ["צ"] = 90, ["ץ"] = 90, ["ק"] = 100, ["ר"] = 200, | |||
["ש"] = 300, ["ת"] = 400, ["'"] = 0, ["\""] = 0, | |||
} | |||
local ans = 0 | local ans = 0 | ||
local str = s | local str = s | ||
while len1(str) > 0 do | while len1(str) > 0 do | ||
ans = ans + numberstable[sub1(str, 1, 1)] | |||
str = sub1(str, 2, len1(str)) | str = sub1(str, 2, len1(str)) | ||
end | end | ||
return ans | return ans | ||
end | end | ||
function mindate(fix, frame) | function mindate(fix, frame) | ||
local monthtable = { | |||
["בתשרי"] = 7, | |||
["בחשוון"] = 8, | |||
["בכסלו"] = 9, | |||
["בטבת"] = 10, | |||
["בשבט"] = 11, | |||
["באדר א'"] = 12, | |||
["באדר ב'"] = 13, | |||
["באדר"] = 13, | |||
["בניסן"] = 1, | |||
["באייר"] = 2, | |||
["בסיוון"] = 3, | |||
["בתמוז"] = 4, | |||
["באב"] = 5, | |||
["באלול"] = 6, | |||
} | |||
local indenttable = {176, 206, 235, 265, 294, 324, 0, 30, 59, 88, 117, 147, 147} | |||
return to("28-08-" .. frame:callParserFunction("padleft", {hebnum(sub1(fix[3], 3, len1(fix[3]))) + 1000 * | return to("28-08-" .. frame:callParserFunction("padleft", {hebnum(sub1(fix[3], 3, len1(fix[3]))) + 1000 * | ||
hebnum(sub1((fix[3]), 1, 2)) - 3761, 4}) .. " + " .. | hebnum(sub1((fix[3]), 1, 2)) - 3761, 4}) .. " + " .. (indenttable[monthtable[fix[2]]] + hebnum(fix[1]) - 1) .. " days", frame) | ||
end | end | ||
function exacttdate(hdate, mindate, frame) | function exacttdate(hdate, mindate, frame) | ||
local count = 0 | local count = 0 | ||