Module:Param Parse: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Fix image function bug for nil images)
(release)
Line 159: Line 159:
}
}


-- Release (TODO)
-- 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 = {
parse.release = {
name = 'release',
name = 'release',
func = parse.has_content,
func = parse.release_func,
smw_property = 'Release Date',
smw_func = parse.release_smw,
}
}