Modul:Zeit: Unterschied zwischen den Versionen
keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 109: | Zeile 109: | ||
args = frame:getParent().args | args = frame:getParent().args | ||
local | local paramsTypen = { astronomisch = 'astronomisch', meteorologisch = 'meteorologisch' } | ||
local errorStr = ''; | |||
local | local fruehling = args['fr'] | ||
if | if fruehling == nil then fruehling = args['fruehling'] end | ||
if | if fruehling == nil then fruehling = args['std'] end | ||
if | if fruehling == nil then fruehling = args['standard'] end | ||
if | if fruehling == nil then fruehling = funcParams['fr'] end | ||
local | local sommer = args['so'] | ||
if | if sommer == nil then sommer = args['sommer'] end | ||
if | if sommer == nil then sommer = args['std'] end | ||
if | if sommer == nil then sommer = args['standard'] end | ||
if | if sommer == nil then sommer = funcParams['so'] end | ||
local | local herbst = args['he'] | ||
if | if herbst == nil then herbst = args['herbst'] end | ||
if | if herbst == nil then herbst = args['std'] end | ||
if | if herbst == nil then herbst = args['standard'] end | ||
if | if herbst == nil then herbst = funcParams['he'] end | ||
local winter = args['wi'] | |||
if winter == nil then winter = args['winter'] end | |||
if winter == nil then winter = args['std'] end | |||
if winter == nil then winter = args['standard'] end | |||
if winter == nil then winter = funcParams['wi'] end | |||
local typ = args['typ'] | |||
if typ == nil then winter = funcParams['typ'] end | |||
local ausgabe = funcParams['std'] | local ausgabe = funcParams['std'] | ||
local monat = lang:formatDate ( 'm' ) | |||
if paramsTypen[typ] == nil then errorStr = check._error ('Falscher Wert für Parameter <emp>typ</emp>: <emp>' .. typ .. '</emp>', 'Zeit' ) end | |||
return check._testParams ( args, funcParams, 'Zeit' ) .. ausgabe | if typ == 'meteorologisch' then | ||
local monat = lang:formatDate ( 'm' ) | |||
if monat == '01' then ausgabe = winter end | |||
if monat == '02' then ausgabe = winter end | |||
if monat == '03' then ausgabe = fruehling end | |||
if monat == '04' then ausgabe = fruehling end | |||
if monat == '05' then ausgabe = fruehling end | |||
if monat == '06' then ausgabe = sommer end | |||
if monat == '07' then ausgabe = sommer end | |||
if monat == '08' then ausgabe = sommer end | |||
if monat == '09' then ausgabe = herbst end | |||
if monat == '10' then ausgabe = herbst end | |||
if monat == '11' then ausgabe = herbst end | |||
if monat == '12' then ausgabe = winter end | |||
end | |||
if typ == 'astronomisch' then | |||
end | |||
return errorStr .. check._testParams ( args, funcParams, 'Zeit' ) .. ausgabe | |||
end | end | ||
return zeit | return zeit |