Difference between revisions of "Module:Sandbox/Ahecht/trim date"
< Module:Sandbox | Ahecht
Jump to navigation
Jump to search
blackwiki>Ahecht (test) |
blackwiki>Ahecht (debug) |
||
| Line 6: | Line 6: | ||
if date == nil then date = "123" end | if date == nil then date = "123" end | ||
date = string.gsub( date, "<.-mw%-formatted%-date.->", "") | date = string.gsub( date, "<.-mw%-formatted%-date.->", "") | ||
| + | date = string.gsub( date, "<.-nowiki.->", "") | ||
date = string.gsub( date, "<.*>", "") | date = string.gsub( date, "<.*>", "") | ||
return date | return date | ||
Revision as of 15:09, 25 April 2017
Documentation for this module may be created at Module:Sandbox/Ahecht/trim date/doc
local p = {}
function p.trim(frame)
local date = frame:getParent().args[1]
if date == nil then date = frame.args[1] end
if date == nil then date = "123" end
date = string.gsub( date, "<.-mw%-formatted%-date.->", "")
date = string.gsub( date, "<.-nowiki.->", "")
date = string.gsub( date, "<.*>", "")
return date
end
return p