Module:Param Parse: Difference between revisions
release
(Fix image function bug for nil images) |
(release) |
||
Line 159:
}
-- Release
function parse.release_smw(date)
if date == nil then
return nil
end
local year, month, day = string.match(date, '(%d+)-(%d+)-(%d+)')
if year == nil or month == nil or day == nil then
return nil
end
return os.time{year=year, month=month, day=day}
end
function parse.release_func(date)
if date == nil then
return nil
end
local unix_time = parse.release_smw(date)
if unix_time == nil then
return nil
end
return os.date("%Y %B %d", unix_time)
end
parse.release = {
name = 'release',
func = parse.
smw_property = 'Release Date',
smw_func = parse.release_smw,
}
|