Modul:Jahr: Unterschied zwischen den Versionen

K
Entfernte den Schutz von „Modul:Jahr
Keine Bearbeitungszusammenfassung
K (Entfernte den Schutz von „Modul:Jahr“)
 
(18 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
local p = {}
local p = {}
local c = require( "Module:Common" )
local c = require("Module:Common")


function p.Zeitleiste( frame )
function p.Zeitleiste(frame)
pf = frame:getParent()
local args = frame:getParent().args
args = pf.args
local title = mw.title.getCurrentTitle().text
pt = mw.title.getCurrentTitle().text
local year = tonumber(title)
year = tonumber(pt)
t = '<div class="jahresleiste"><p>'..
local t = '<div class="kopfleiste"><p>' ..
Jahrhundert(year)..
jahrhundert(year) ..
Jahrzehnt(year)..
--Jahrzehnt(year).. Removed, because it only confuses
Jahre(year)..
jahre(year) ..
'</p></div>'
'</p></div>'
return t
return t
end  
end  


function Jahre(year)
function jahre(year)
t = '[['..tostring(year-1)..'|◄]] | ' ..
return '[['..tostring(year-10)..'|◄]] | ' ..
'[['..tostring(year-5)..']] | ' ..
'[['..tostring(year-5)..']] | ' ..
'[['..tostring(year-4)..']] | ' ..
'[['..tostring(year-4)..']] | ' ..
Zeile 29: Zeile 28:
'[['..tostring(year+4)..']] | ' ..
'[['..tostring(year+4)..']] | ' ..
'[['..tostring(year+5)..']] | ' ..
'[['..tostring(year+5)..']] | ' ..
'[['..tostring(year+1)..'|►]]<br>'
'[['..tostring(year+10)..'|►]]<br>'
return t
end
end


function Jahrzehnt(year)
function jahrzehnt(year)
t = '[['..tostring(year-10)..'|◄]] | '..
local ys = tostring(year)
    'Jahrzehnt | '..
local decade = tonumber(string.sub(ys, -2, -2))
return '[['..tostring(year-10)..'|◄]] | '..
    "'''"..tostring(decade).."0er Jahre''' | "..
'[['..tostring(year+10)..'|►]]<br>'
'[['..tostring(year+10)..'|►]]<br>'
return t
end
end


function Jahrhundert(year)
function jahrhundert(year)
t = '[['..tostring(year-100)..'|◄]] | '..
local ys = tostring(year)
'Jahrhundert | '..
local century = tonumber(string.sub(ys, -4, -3)) + 1
local century_str = tostring(century)..". Jahrhundert"
return '[['..tostring(year-100)..'|◄]] | '..
"[[:Kategorie:"..century_str.."|"..century_str.."]]"..
"[[Kategorie:"..century_str.."]] | "..
'[['..tostring(year+100)..'|►]]<br>'
'[['..tostring(year+100)..'|►]]<br>'
return t
end
end
return p
return p