מייבאים כמותיים, בדוקי עריכות אוטומטית, ביוראקראטן, אינטערפעיס רעדאקטארן, emailconfirmed, אינטערפעיס אדמיניסטראַטאָרן, מנטרים, סיסאפן, צוות טכני, מייבאים, מעדכנים, אספקלריה רעדאקטארן
102,362
רעדאגירונגען
אין תקציר עריכה |
(דא איז דער לאך. קרויז אויס אידישע דאטום צו רעכענען אויך בעפאר קביעת הלוח) |
||
| שורה 6: | שורה 6: | ||
local hebrewDateModule = require('Module:אידישע דאטום') | local hebrewDateModule = require('Module:אידישע דאטום') | ||
local WikidataCrossValidation = require('Module:WikidataCrossValidation') | local WikidataCrossValidation = require('Module:WikidataCrossValidation') | ||
local gim = require( "Module:גימטריה" ) | |||
function count(str, substring) | |||
local count = 0 | |||
local _, occurrences = string.gsub(str, substring, function() | |||
count = count + 1 | |||
end) | |||
return count | |||
end | |||
--[[ Get general date if known, otherwise guess from hebrew date. | --[[ Get general date if known, otherwise guess from hebrew date. | ||
| שורה 200: | שורה 209: | ||
end | end | ||
local | -- יחידה:אידישע דאטום ווערט פארלוירן מיט יארן בעפאר ד'ק"כ | ||
local | local genBirthDate = templateArgs['תאריך לידה'] or templateArgs['געבורט דאטום'] | ||
if genBirthDate == nil and templateArgs['תאריך לידה עברי'] ~= nil then | |||
local l = frame:preprocess(args['תאריך לידה עברי']) -- preprocess, to handle {{לינק צו אידיש יאר}} | |||
if (#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 ) | |||
if #birthParts == 1 then | |||
table.insert(birthParts, 1, 0) -- אדער אלף החמישי? | |||
end | |||
local BirthDateNum = gim.gimatria(birthParts[1])*1000 + gim.gimatria(birthParts[2]) - 3760 | |||
if BirthDateNum < 1 then | |||
genBirthDate = tostring(math.abs(BirthDateNum)) .. " לפנה\"ס" | |||
elseif BirthDateNum < 4120 then | |||
genBirthDate = tostring(BirthDateNum) | |||
end | |||
end | |||
end | |||
local genDeathDate = templateArgs['תאריך פטירה'] or templateArgs['פטירה דאטום'] | |||
if genDeathDate == nil and templateArgs['תאריך פטירה עברי'] ~= nil then | |||
local p = frame:preprocess(args['תאריך פטירה עברי']) -- preprocess, to handle {{לינק צו אידיש יאר}} | |||
if (#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 ) | |||
if #deathParts == 1 then | |||
table.insert(deathParts, 1, 0) -- אדער אלף החמישי? | |||
end | |||
local DeathDateNum = gim.gimatria(deathParts[1])*1000 + gim.gimatria(deathParts[2]) - 3760 | |||
if DeathDateNum < 1 then | |||
genDeathDate = tostring(math.abs(DeathDateNum)) .. " לפנה\"ס" | |||
elseif DeathDateNum < 4120 then | |||
genDeathDate = tostring(DeathDateNum) | |||
end | |||
end | |||
end | |||
local birthDate = getSpeculativeDate(genBirthDate, templateArgs['תאריך לידה עברי']) | |||
local deathDate = getSpeculativeDate(genDeathDate, templateArgs['תאריך פטירה עברי']) | |||
if birthDate~=nil then | if birthDate~=nil then | ||
רעדאגירונגען