אונטערשייד צווישן ווערסיעס פון "יחידה:דאטום"

727 בייטן צוגעלייגט ,  פֿאַר 2 יאָר
דיוק
(אויך MDY (אפריל 2, 1990) זאל ארבעטן)
צייכן: צוריקגעשטעלט
(דיוק)
 
(10 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.)
שורה 458: שורה 458:


     return Date.new( definition )
     return Date.new( definition )
end
local function extractNumbers(inputString)
    local numbers = inputString:match("^(%d+[%s%d-]*)")
    return numbers or ""
end
end


שורה 478: שורה 483:
wikitext = mw.ustring.gsub(wikitext, "‏","")
wikitext = mw.ustring.gsub(wikitext, "‏","")
wikitext = mw.ustring.gsub(wikitext, "‎","")
wikitext = mw.ustring.gsub(wikitext, "‎","")
wikitext = mw.ustring.gsub(wikitext, ",","")
-- BC to minus
-- BC to minus
wikitext = mw.ustring.gsub( wikitext, "([0-9]+) לפנה[\"״]ס" , "-%1")
wikitext = mw.ustring.gsub( wikitext, "([0-9]+) לפנה[\"״]ס" , "-%1")
    wikitext = mw.ustring.gsub( wikitext, "([0-9]+) אא[\"״]ר" , "-%1")
    wikitext = mw.ustring.gsub( wikitext, "([0-9]+) בצ[\"״]ר" , "-%1")
    wikitext = mw.ustring.gsub( wikitext, "([0-9]+) פד[\"״]צ" , "-%1")


if mw.ustring.match(wikitext, '^המאה ה[־-]%d+$') then
if mw.ustring.match(wikitext, '^המאה ה[־-]%d+$') then
local yearStr = mw.ustring.match(wikitext, '^המאה ה[־-](%d+)$')
local yearStr = mw.ustring.match(wikitext, '^המאה ה[־-](%d+)$')
                return Date.new( { year=tonumber(yearStr)*100, month=0, day=0, precision= Date.PRECISION.YEAR100 } )
end
    if mw.ustring.match(wikitext, "%d+['ס]?ט[ען]ר? י") then
local yearStr = mw.ustring.match(wikitext, "(%d+)['ס]?ט[ען]ר? י")
                 return Date.new( { year=tonumber(yearStr)*100, month=0, day=0, precision= Date.PRECISION.YEAR100 } )
                 return Date.new( { year=tonumber(yearStr)*100, month=0, day=0, precision= Date.PRECISION.YEAR100 } )
end
end
שורה 827: שורה 841:
local t1 = Date.newFromWikitext( parts[1] )
local t1 = Date.newFromWikitext( parts[1] )
local t2
local t2
local useCurrent = #parts<2 or (parts[2] == 'היום' or parts[2]=='הווה')
local useCurrent = #parts<2 or (parts[2] == 'היינט' or parts[2]=='הווה' or parts[2]=='אנגייענד' or parts[2]=='איצט')
if not useCurrent then
if not useCurrent then
שורה 957: שורה 971:
str= mw.ustring.gsub(str,"כ(.+)","%1");
str= mw.ustring.gsub(str,"כ(.+)","%1");
str= mw.ustring.gsub(str,"־(.+)","%1");
str= mw.ustring.gsub(str,"־(.+)","%1");
str= mw.ustring.gsub(str," יאר","")
str= mw.ustring.gsub(str," יאָרן","")
if str == "שנתיים" then
if str == "שנתיים" then
str = 2
str = 2
שורה 964: שורה 978:
str = 1
str = 1
end
end
str = mw.ustring.gsub(str," שנה", "")
str = mw.ustring.gsub(str," יאָר", "")
if tonumber(str) > 0 and
if tonumber(str) > 0 and
tonumber(parseDateRange(frame.args[1], "raw", inclusive)) < 0 then
tonumber(parseDateRange(frame.args[1], "raw", inclusive)) < 0 then