FANDOM


local p = {}
 
function p.test()
	return "Hello, world!"
end
 
function p.BirthdateAndAge(frame) --Birthday and age
    local Date1 = frame.args[1]
    local Date2 = frame.args[2] or os.date("%d.%m.%Y",os.time()+32400) --If no second date, Japan time
    Age = YearsAge(Date1,Date2)
   -- _, _, d1, m1, y1 = string.find(Date1, "(%d+).(%d+).(%d+)")
   -- Date1a = y1*10000+m1*100+d1 --Forms a yyyymmdd number
   -- _, _, d2, m2, y2 = string.find(Date2, "(%d+).(%d+).(%d+)")
   -- Date2a = y2*10000+m2*100+d2 --Forms a yyyymmdd number
   -- YearsAge = math.floor((Date2a-Date1a)/10000)
 
    --return Date1 .. " " .. Date1a .. " " .. Date2 .. " " .. Date2a .. " " .. Date1 .. " (" .. YearsAge .. " let)"
    return Date1 .. " (" .. Age .. " let)[[Kategorie:Rok narození: " .. y1 .. "]][[Kategorie:Měsíc narození: " .. CzechMonths(m1) .. "]]"
end
 
function p.Age(frame) --Age only
    local Date1 = frame.args[1]
    local Date2 = frame.args[2] or os.date("%d.%m.%Y",os.time()+32400) --If no second date, Japan time
    Age = YearsAge(Date1,Date2)
   -- _, _, d1, m1, y1 = string.find(Date1, "(%d+).(%d+).(%d+)")
   -- Date1a = y1*10000+m1*100+d1 --Forms a yyyymmdd number
   -- _, _, d2, m2, y2 = string.find(Date2, "(%d+).(%d+).(%d+)")
   -- Date2a = y2*10000+m2*100+d2 --Forms a yyyymmdd number
   -- YearsAge = math.floor((Date2a-Date1a)/10000)
 
    --return Date1 .. " " .. Date1a .. " " .. Date2 .. " " .. Date2a .. " " .. Date1 .. " (" .. YearsAge .. " let)"
    return Age
end
 
 
function YearsAge(Date1, Date2)
    _, _, d1, m1, y1 = string.find(Date1, "(%d+).(%d+).(%d+)")
    Date1a = y1*10000+m1*100+d1 --Forms a yyyymmdd number
    _, _, d2, m2, y2 = string.find(Date2, "(%d+).(%d+).(%d+)")
    Date2a = y2*10000+m2*100+d2 --Forms a yyyymmdd number
    YearsAge = math.floor((Date2a-Date1a)/10000)
    return YearsAge
end
 
function CzechMonths(SomeNumber)
    SomeNumber = SomeNumber + 0
    if SomeNumber == 1 then return "leden"
    elseif SomeNumber == 2 then return "únor"
    elseif SomeNumber == 3 then return "březen"
    elseif SomeNumber == 4 then return "duben"
    elseif SomeNumber == 5 then return "květen"
    elseif SomeNumber == 6 then return "červen"
    elseif SomeNumber == 7 then return "červenec"
    elseif SomeNumber == 8 then return "srpen"
    elseif SomeNumber == 9 then return "září"
    elseif SomeNumber == 10 then return "říjen"
    elseif SomeNumber == 11 then return "listopad"
    elseif SomeNumber == 12 then return "prosinec"
    else return "nikdy"
    end
end
 
function p.test1()
    output = CzechMonths(1) .. " " .. CzechMonths(01) .. " " .. CzechMonths(001) .. " " .. CzechMonths(2)
    return output
end
 
function p.BirthdateAndAgeCopy(frame) --Birthday and age
    local Date1 = frame.args[1]
    local Date2 = frame.args[2] or os.date("%d.%m.%Y",os.time()+32400) --If no second date, Japan time
    Age = YearsAge(Date1,Date2)
   -- _, _, d1, m1, y1 = string.find(Date1, "(%d+).(%d+).(%d+)")
   -- Date1a = y1*10000+m1*100+d1 --Forms a yyyymmdd number
   -- _, _, d2, m2, y2 = string.find(Date2, "(%d+).(%d+).(%d+)")
   -- Date2a = y2*10000+m2*100+d2 --Forms a yyyymmdd number
   -- YearsAge = math.floor((Date2a-Date1a)/10000)
 
    --return Date1 .. " " .. Date1a .. " " .. Date2 .. " " .. Date2a .. " " .. Date1 .. " (" .. YearsAge .. " let)"
    --return Date1 .. " (" .. Age .. " let)[[Kategorie:Rok narození: " .. y1 .. "]][[Kategorie:Měsíc narození: " .. CzechMonths(m1) .. "]]"
    return y1 .. " " .. m1 .. " " .. d1 .. " " .. CzechMonths(m1)
end
 
 
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

V síti Wikia

Náhodná Wiki