15.075
Bearbeitungen
Keine Bearbeitungszusammenfassung |
K (Entfernte den Schutz von „Modul:Jahr“) |
||
| (28 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) | ||
local args = frame:getParent().args | |||
local title = mw.title.getCurrentTitle().text | |||
local year = tonumber(title) | |||
year = tonumber( | |||
t = '<div class=" | local t = '<div class="kopfleiste"><p>' .. | ||
jahrhundert(year) .. | |||
--Jahrzehnt(year).. Removed, because it only confuses | |||
jahre(year) .. | |||
'</p></div>' | '</p></div>' | ||
return t | return t | ||
end | end | ||
function jahre(year) | |||
return '[['..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>' | |||
end | |||
function jahrzehnt(year) | |||
local ys = tostring(year) | |||
local decade = tonumber(string.sub(ys, -2, -2)) | |||
return '[['..tostring(year-10)..'|◄]] | '.. | |||
"'''"..tostring(decade).."0er Jahre''' | ".. | |||
'[['..tostring(year+10)..'|►]]<br>' | |||
end | |||
function jahrhundert(year) | |||
local ys = tostring(year) | |||
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>' | |||
end | |||
return p | return p | ||