Modul:Jahr
Aus FürthWiki
Seiten-Übersicht
| Hauptseite | Unterseiten | ||
|---|---|---|---|
| Allgemein | |||
| Faktenbox | Vorlagen | ||
| Formulare |
|
||
| Module | |||
| Abfrage | Vorlagen |
| |
| Formulare |
| ||
| Sonstige | |||
Doku
Das Modul "Jahr" wird über die Vorlage {{Jahr}} in einen Artikel eingebunden, welcher für ein Jahr steht (z. B. 333).
local p = {}
local c = require( "Module:Common" )
function p.Zeitleiste( frame )
pf = frame:getParent()
args = pf.args
pt = mw.title.getCurrentTitle().text
year = tonumber(pt)
t = '<div class="jahresleiste"><p>'..
Jahrhundert(year)..
--Jahrzehnt(year).. Removed, because it only confuses
Jahre(year)..
'</p></div>'
return t
end
function Jahre(year)
t = '[['..tostring(year-10)..'|◄]] | ' ..
'[['..tostring(year-5)..']] | ' ..
'[['..tostring(year-4)..']] | ' ..
'[['..tostring(year-3)..']] | ' ..
'[['..tostring(year-2)..']] | ' ..
'[['..tostring(year-1)..']] | ' ..
'[['..tostring(year)..']] | ' ..
'[['..tostring(year+1)..']] | ' ..
'[['..tostring(year+2)..']] | ' ..
'[['..tostring(year+3)..']] | ' ..
'[['..tostring(year+4)..']] | ' ..
'[['..tostring(year+5)..']] | ' ..
'[['..tostring(year+10)..'|►]]<br>'
return t
end
function Jahrzehnt(year)
ys = tostring(year)
decade = tonumber(string.sub(ys, -2, -2))
t = '[['..tostring(year-10)..'|◄]] | '..
"'''"..tostring(decade).."0er Jahre''' | "..
'[['..tostring(year+10)..'|►]]<br>'
return t
end
function Jahrhundert(year)
ys = tostring(year)
century = tonumber(string.sub(ys, -4, -3)) + 1
century_str = tostring(century)..". Jahrhundert"
t = '[['..tostring(year-100)..'|◄]] | '..
"[[:Kategorie:"..century_str.."|"..century_str.."]]"..
"[[Kategorie:"..century_str.."]] | "..
'[['..tostring(year+100)..'|►]]<br>'
return t
end
return p