RogerDodger (talk | contribs) (split to Module:Changelog) |
RogerDodger (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
-- | -- The bool param decides whether [[Module:Changelog]] checks the page when | ||
-- creating a character's changelogs. Eventually won't be needed when all patch | |||
-- notes are on wiki. | |||
local versions = { | local versions = { | ||
{ "4.20", "27 May 2021" }, | { "4.20", "27 May 2021", true }, | ||
{ "4.10", "22 Mar 2021" }, | { "4.10", "22 Mar 2021", true }, | ||
{ "4.01", "26 Nov 2020" }, | { "4.01", "26 Nov 2020", true }, | ||
{ "4.00", "10 Nov 2020" }, | { "4.00", "10 Nov 2020", true }, | ||
{ "3.33", "19 Aug 2020" }, | { "3.33", "19 Aug 2020", true }, | ||
{ "3.32", "17 Jun 2020" }, | { "3.32", "17 Jun 2020", true }, | ||
{ "3.31", "21 Apr 2020" }, | { "3.31", "21 Apr 2020", true }, | ||
{ "3.30", "20 Mar 2020" }, | { "3.30", "20 Mar 2020", true }, | ||
{ "3.21", "12 Feb 2020" }, | { "3.21", "12 Feb 2020", true }, | ||
{ "3.20", "28 Jan 2020" }, | { "3.20", "28 Jan 2020", true }, | ||
{ "3.10", "10 Dec 2019" }, | { "3.10", "10 Dec 2019", true }, | ||
{ "3.03", "12 Nov 2019" }, | { "3.03", "12 Nov 2019", true }, | ||
{ "3.01", "03 Oct 2019" }, | { "3.01", "03 Oct 2019", true }, | ||
{ "3.00", "05 Sep 2019", true }, | |||
{ "2.30", "30 May 2019" }, | |||
{ "2.20", "28 Feb 2019" }, | |||
{ "2.11", "14 Dec 2018" }, | |||
{ "2.10", "03 Dec 2018" }, | |||
{ "2.02", "01 Nov 2018" }, | |||
{ "2.00", "04 Sep 2018" }, | |||
{ "1.12", "21 Mar 2018" }, | |||
{ "1.08", "28 Sep 2017" }, | |||
} | } | ||
Line 26: | Line 37: | ||
p._date = function(v) | p._date = function(v) | ||
for | local i = p._find(v) | ||
if i == nil then return "" end | |||
return versions[i][2] | |||
end | |||
p._find = function(v) | |||
for i, version in ipairs(versions) do | |||
if version[1] == v then | if version[1] == v then | ||
return | return i | ||
end | end | ||
end | end | ||
return | return nil | ||
end | end | ||
return p | return p |
Revision as of 01:07, 30 June 2022
Documentation for this module may be created at Module:Patch/doc
local p = {}
-- The bool param decides whether [[Module:Changelog]] checks the page when
-- creating a character's changelogs. Eventually won't be needed when all patch
-- notes are on wiki.
local versions = {
{ "4.20", "27 May 2021", true },
{ "4.10", "22 Mar 2021", true },
{ "4.01", "26 Nov 2020", true },
{ "4.00", "10 Nov 2020", true },
{ "3.33", "19 Aug 2020", true },
{ "3.32", "17 Jun 2020", true },
{ "3.31", "21 Apr 2020", true },
{ "3.30", "20 Mar 2020", true },
{ "3.21", "12 Feb 2020", true },
{ "3.20", "28 Jan 2020", true },
{ "3.10", "10 Dec 2019", true },
{ "3.03", "12 Nov 2019", true },
{ "3.01", "03 Oct 2019", true },
{ "3.00", "05 Sep 2019", true },
{ "2.30", "30 May 2019" },
{ "2.20", "28 Feb 2019" },
{ "2.11", "14 Dec 2018" },
{ "2.10", "03 Dec 2018" },
{ "2.02", "01 Nov 2018" },
{ "2.00", "04 Sep 2018" },
{ "1.12", "21 Mar 2018" },
{ "1.08", "28 Sep 2017" },
}
p.versions = versions
p.date = function(frame)
local v = frame.args[1]
return p._date(v)
end
p._date = function(v)
local i = p._find(v)
if i == nil then return "" end
return versions[i][2]
end
p._find = function(v)
for i, version in ipairs(versions) do
if version[1] == v then
return i
end
end
return nil
end
return p