Modul:Jahrestag: Unterschied zwischen den Versionen

Aus FürthWiki

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 7: Zeile 7:
pt = mw.title.getCurrentTitle().text
pt = mw.title.getCurrentTitle().text
t = [[
t = '<table class="wikitable">'..
<table class="wikitable">
'<tr>'..
  <tr>
    '<th>◄</th>'..
    <th>one</th>
    '<th>[[:Kategorie:Februar|Februar]]</th>'..
    <th>two</th>
    '<th></th>'..
  </th>
'</th>'..
  <tr>
'<tr>'..
    <td>one</td>
    '<td>one</td>'..
    <td>two</td>
    '<td>two</td>'..
  </tr>
'</tr>'..
</table>
'</table>'
]]
return t
return t
end  
end  

Version vom 22. Januar 2025, 19:14 Uhr

p.Kalender

Diese Funktion bildet einen Monatstage-Kasten ab und wird per #invoke: eingebunden. Der Monat wird dem Lemma entnommen, weshalb diese Funktion keine Attribute benötigt.

p.woche

Eine nur von p.Kalender genutzte Funktion, welche die Anzahl der Wochentage für den jeweiligen Monat berechnet.


local p = {}
local c = require( "Module:Common" )

function p.Kalender( frame )
	pf = frame:getParent()
	args = pf.args
	pt = mw.title.getCurrentTitle().text
	
	t = '<table class="wikitable">'..
		'<tr>'..
    	'<th>◄</th>'..
    	'<th>[[:Kategorie:Februar|Februar]]</th>'..
    	'<th>►</th>'..
		'</th>'..
		'<tr>'..
    	'<td>one</td>'..
    	'<td>two</td>'..
		'</tr>'..
		'</table>'
	return t
end 

function Jahre(year)
	t = '[['..tostring(year-1)..'|◄]] | ' ..
		'[['..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+1)..'|►]]<br>'
	return t
end

function Jahrzehnt(year)
	t = '[['..tostring(year-10)..'|◄]] | '..
	    'Jahrzehnt | '..
		'[['..tostring(year+10)..'|►]]<br>'
	return t
end
return p