Module:Update: Skirtumas tarp puslapio versijų

346 pridėti baitai ,  12 balandžio
S
nėra keitimo aprašymo
Nėra keitimo santraukos
SNėra keitimo santraukos
 
412 eilutė: 412 eilutė:
    return 'Error: Missing required argument `%TITLE%`.'
    return 'Error: Missing required argument `%TITLE%`.'
end
end
local page = a['%TITLE%']
local year
local year
local cat
local cat
local page = a['%TITLE%']
if hc(a.year) then
if hc(a.year) then
year = a.year
year = a.year
421 eilutė: 423 eilutė:
end
end
-- Get current day and month from system
local current_day = tonumber(lang:formatDate('j'))      -- 12
local current_month = lang:formatDate('F')              -- April
--  Get day and month from the provided date
local entry_day = tonumber(lang:formatDate('j', a.date))
local entry_month = lang:formatDate('F', a.date)
--  Check if day and month match
if not (current_day == entry_day and current_month == entry_month) then
return ''  -- Don't display this entry
end
-- Set category type
if hc(a.category) then
if hc(a.category) then
    -- if it has category, {{Update}}
    local category_key = cat_switch[string.gsub(string.lower(a.category), ' ?updates?', '')]
    local category_key = cat_switch[string.gsub(string.lower(a.category), ' ?updates?', '')]
    if category_key then
    if category_key then
        cat = category_info[category_key][2]
        cat = category_info[category_key][2]
    else
    else
        -- If the category key doesn't exist, default to 'Patch Notes'
        cat = 'Patch Notes'
        cat = 'Patch Notes'
    end
    end
else
else
    -- missing both probably means {{Patch Notes}}
    cat = 'Patch Notes'
    cat = 'Patch Notes'
end
end


return string.format("'''%s''' – %s: [[%s|%s]]", year, cat, page, page)
return string.format("'''%s''' – %s: [[%s|%s]]",year,cat,page,page)
end
end