Modul:Zeit: Unterschied zwischen den Versionen

keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 210: Zeile 210:
lang = mw.language.new ( 'de' );
lang = mw.language.new ( 'de' );
local jahr = lang:formatDate ( 'Y' )
params = mw.loadData('Modul:Zeit/Params')
params = mw.loadData('Modul:Zeit/Params')
Zeile 220: Zeile 221:
local von_monat = args['von_monat']
local von_monat = args['von_monat']
if von_monat == nil then von_monat = funcParams['von_monat'] end
if von_monat == nil then von_monat = funcParams['von_monat'] end
local bis_tag = args['bis_tag']
if bis_tag == nil then bis_tag = funcParams['bis_tag'] end
local bis_monat = args['bis_monat']
local bis_monat = args['bis_monat']
if bis_monat == nil then bis_monat = funcParams['bis_monat'] end
if bis_monat == nil then bis_monat = funcParams['bis_monat'] end
local bis_tag = args['bis_tag']
if bis_tag == nil then
bis_tag = funcParams['bis_tag']
if bis_monat == 02 then
bis_tag = 28
if jahr / 4 == math.floor ( jahr / 4 ) then bis_tag = 29 end
end
if bis_monat == 04 then bis_tag = 30 end
if bis_monat == 06 then bis_tag = 30 end
if bis_monat == 09 then bis_tag = 30 end
if bis_monat == 11 then bis_tag = 30 end
end
local inhalt = args['inhalt']
local inhalt = args['inhalt']
Zeile 238: Zeile 249:


local ausgabe = standard
local ausgabe = standard
local differenz = os.difftime ( os.time(), os.time ( { year = jahr, month = '01', day = '01' } ) )
heute = math.floor ( differenz / 86400 +0.5 )
differenz = os.difftime ( os.time(), os.time ( { year = jahr, month = von_monat, day = von_tag } ) )
von = math.floor ( differenz / 86400 +0.5 )
differenz = os.difftime ( os.time(), os.time ( { year = jahr, month = bis_monat, day = bis_tag } ) )
bis = math.floor ( differenz / 86400 +0.5 )
if heute >= von and heute <= bis then ausgabe = inhalt end
return errorStr .. check._testParams ( args, funcParams, 'Zeit' ) .. ausgabe
return errorStr .. check._testParams ( args, funcParams, 'Zeit' ) .. ausgabe
Anonymer Benutzer