Modul:Chronik: Unterschied zwischen den Versionen

keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 17: Zeile 17:
}
}
-- Wenn das Lemma eine Jahreszahl ist, merken
-- Wenn das Lemma eine Jahreszahl ist, merken
if istJahreszahl(titlename) then
if c.istJahreszahl(titlename) then
year = titlename
year = titlename
     end
     end
     local data_date = dateParsing(args[1], year)
     local data_date = p.dateParsing(args[1], year)
     local all_data = merge_tables(data, data_date)
     local all_data = c.merge_tables(data, data_date)
return data_date["Startdatum"] .. ": " .. args[2] --.. '<br>' ..
return data_date["Startdatum"] .. ": " .. args[2] --.. '<br>' ..
--tableToString(all_data)
--tableToString(all_data)
end
end


function dateParsing(s, year)
function p.dateParsing(s, year)
-- Parses a date down where s is the datestring and year can be nil or string
-- Parses a date down where s is the datestring and year can be nil or string
Zeile 36: Zeile 36:
-- Ist eine Zeitspanne wie "3. bis 5. Mai" angegeben, kopiere Monat aus Enddatum  
-- Ist eine Zeitspanne wie "3. bis 5. Mai" angegeben, kopiere Monat aus Enddatum  
local sds = checkYear(dates[1], year)
local sds = p.checkYear(dates[1], year)
local sd = human_to_form_date(dates[1])
local sd = lfd.human_to_form_date(dates[1])
local data = {
local data = {
Zeile 43: Zeile 43:
["SDstring"] = dates[1],
["SDstring"] = dates[1],
["Startdatum"] = sd,
["Startdatum"] = sd,
["Startjahr"] = get_year(sd),
["Startjahr"] = lsd.get_year(sd),
["Starttag"] = get_monthday(sd),
["Starttag"] = lsd.get_monthday(sd),
["length"] = c.len(dates),
["length"] = c.len(dates),
["year"] = year,
["year"] = year,
Zeile 52: Zeile 52:
if c.len(dates) >= 2 then
if c.len(dates) >= 2 then
-- War eine Zeitspanne angegeben gibt es ein Endatum
-- War eine Zeitspanne angegeben gibt es ein Endatum
ed=human_to_form_date(dates[2])
ed=lfd.human_to_form_date(dates[2])
data["EDstring"] = dates[2]
data["EDstring"] = dates[2]
data["Enddatum"] = ed
data["Enddatum"] = ed
data["Endjahr"] = get_year(ed)
data["Endjahr"] = lsd.get_year(ed)
data["Endtag"] = get_monthday(ed)
data["Endtag"] = lsd.get_monthday(ed)
end
end
if c.len(dates) >= 3 then
if c.len(dates) >= 3 then
Zeile 64: Zeile 64:
end
end


function checkYear(s, year)
function p.checkYear(s, year)
-- Wenn s nicht auf eine Jahreszahl endet, dann füge diese hinzu
-- Wenn s nicht auf eine Jahreszahl endet, dann füge diese hinzu
     return s
     return s
end
end


function checkMonth(s, month)
function p.checkMonth(s, month)
-- Aua
-- Aua
return s
return s
82.367

Bearbeitungen