Module:Param Parse: Difference between revisions

Parse the update date in case someone inputs a non-standard date into the template (e.g. they write 2024-1-1 instead of 2024-01-01)
(Attempt at automated update link)
(Parse the update date in case someone inputs a non-standard date into the template (e.g. they write 2024-1-1 instead of 2024-01-01))
Line 179:
local formatted_date = os.date('[[%d %B]] [[%Y]]', time) -- [[01 January]] [[2024]]
formatted_date = string.gsub(formatted_date, '%[%[0', '[[') -- Convert [[01 January]] [[2024]] to [[1 January]] [[2024]]
local iso_date = os.date('%Y-%m-%d', time) -- 2024-01-01
formatted_datelocal update_string = formatted_date .. ' ([[Game updates/' .. dateiso_date .. '|Update]])'
return formatted_date
return update_string
end
function parse.release_smw(date)