|
|
| Zeile 93: |
Zeile 93: |
| -- mw.log(filter) | | -- mw.log(filter) |
| return filter | | return filter |
| end
| |
|
| |
| function p.dateLastDayCompleter(date)
| |
| local last_date
| |
| if #date == 4 then -- nur "Jahr" vorhanden
| |
| last_date = date .. "/12/31"
| |
| elseif #date ~= 10 then -- "Monat Jahr" vorhanden
| |
| local days = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
| |
| local month = string.sub(date, 1, string.find(date, " ") - 1)
| |
| month = com.getMonthnr(month)
| |
| local year = string.sub(date, string.find(date, " ") + 1)
| |
| last_date = year .. "/" .. month .. "/"
| |
| if month == 2 and year % 4 == 0 then -- Sonderfall Feb. Schaltjahr
| |
| last_date = last_date .. "29"
| |
| else
| |
| last_date = last_date .. days[month]
| |
| end
| |
| else
| |
| last_date = date
| |
| end
| |
| return last_date
| |
| end | | end |
|
| |
|