מייבאים כמותיים, בדוקי עריכות אוטומטית, ביוראקראטן, אינטערפעיס רעדאקטארן, emailconfirmed, אינטערפעיס אדמיניסטראַטאָרן, מנטרים, סיסאפן, צוות טכני, מייבאים, מעדכנים, אספקלריה רעדאקטארן
102,362
רעדאגירונגען
ק (הגהה) |
(באהאנדלען אויך {{לינק צו אידיש יאר}}) |
||
| שורה 6: | שורה 6: | ||
['future-date'] = '[[קאטעגאריע:אומריכטיגע לעבן דאטומען]]' | ['future-date'] = '[[קאטעגאריע:אומריכטיגע לעבן דאטומען]]' | ||
} | } | ||
function count(str, substring) | |||
local count = 0 | |||
local _, occurrences = string.gsub(str, substring, function() | |||
count = count + 1 | |||
end) | |||
return count | |||
end | |||
function ToDate(frame, Date, ApproxDate) | function ToDate(frame, Date, ApproxDate) | ||
| שורה 61: | שורה 69: | ||
--local age_string = args['מציין'] | --local age_string = args['מציין'] | ||
local BirthDateStr = args['געבורט דאטום'] or args['תאריך לידה עברי'] | local BirthDateStr = args['געבורט דאטום'] or args['תאריך לידה עברי'] | ||
if args['געבורט דאטום'] == nil and #mw.text.split( | local l = frame:preprocess(args['תאריך לידה עברי']) -- preprocess, to handle {{לינק צו אידיש יאר}} | ||
local birthParts = mw.text.split( | if args['געבורט דאטום'] == nil and (#mw.text.split(l, '%s' ) == 1 or count(l, "%[%[") == 1) then --most probably just year or yearlink | ||
if #mw.text.split(l, '%s' ) > 1 then | |||
l = l:match("%[%[.-|(.*)%]%]") | |||
end | |||
local birthParts = mw.text.split( l, "'", true ) | |||
local BirthDateNum = gim.gimatria(birthParts[1])*1000 + gim.gimatria(birthParts[2]) - 3760 | local BirthDateNum = gim.gimatria(birthParts[1])*1000 + gim.gimatria(birthParts[2]) - 3760 | ||
if BirthDateNum < 1 then | if BirthDateNum < 1 then | ||
| שורה 72: | שורה 84: | ||
--error(BirthDateStr) | --error(BirthDateStr) | ||
local DeathDateStr = args['פטירה דאטום'] or args['תאריך פטירה עברי'] | local DeathDateStr = args['פטירה דאטום'] or args['תאריך פטירה עברי'] | ||
if args['פטירה דאטום'] == nil and #mw.text.split( | local p = frame:preprocess(args['תאריך פטירה עברי']) | ||
local deathParts = mw.text.split( | if args['פטירה דאטום'] == nil and (#mw.text.split(p, '%s' ) == 1 or count(p, "%[%[") == 1) then --most probably just year or yearlink | ||
if #mw.text.split(p, '%s' ) > 1 then | |||
p = p:match("%[%[.-|(.*)%]%]") | |||
end | |||
local deathParts = mw.text.split( p, "'", true ) | |||
local DeathDateNum = gim.gimatria(deathParts[1])*1000 + gim.gimatria(deathParts[2]) - 3760 | local DeathDateNum = gim.gimatria(deathParts[1])*1000 + gim.gimatria(deathParts[2]) - 3760 | ||
if DeathDateNum < 1 then | if DeathDateNum < 1 then | ||
רעדאגירונגען