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