Module:ComicsInfobox/Volume

local Infobox = {}

-- Libraries of functions --

-- stands for High Frequency local HF = require('Module:ComicsHF') -- Parses invocation parameters, trims whitespace, and removes blanks local getArgs = require('Dev:Arguments').getArgs -- Common and centralized functions local ComicsInfobox = require('Module:ComicsInfobox') local MonthParse = require("Module:Month") local L = require('Dev:List') local lang = mw.language.new('en')

--- -- Libraries of data -- --- -- Data tables for common Staff contributors local StaffNames = require( 'Module:StaffCorrection' )

-- Since this should only be evaluated once per pageview, it's now global _G.vars = { Pagename = mw.title.getCurrentTitle.text }

- -- Local functions -- - function Infobox.DatesPublished( frame ) local args = getArgs(frame, { trim = true, removeBlanks = true }) return Infobox._DatesPublished(args) end function Infobox.DatesPublishedLabel( frame ) local args = getArgs(frame, { trim = true, removeBlanks = true }) return Infobox._DatesPublishedLabel(args) end

function Infobox._DatesPublished( args ) local StartYear = args.StartYear or nil local EndYear = args.EndYear or nil local StartMonth = args.StartMonth or nil local EndMonth = args.EndMonth or nil if StartMonth then StartMonth = MonthParse.month(StartMonth) end if EndMonth then EndMonth = MonthParse.month(EndMonth) end if StartMonth then output = HF.LinkToCategory(StartMonth, StartMonth) .. ', ' ..           HF.LinkToCategory(StartYear, StartYear) .. ' &mdash; '       if EndYear and EndMonth then output = output .. HF.LinkToCategory(EndMonth, EndMonth) .. ', ' ..           HF.LinkToCategory(EndYear, EndYear) .. ' &mdash; '       end return output elseif EndYear then return '(' ..           HF.LinkToCategory(StartYear, StartYear) ..            '-' ..            HF.LinkToCategory(EndYear, EndYear) ..            ')' elseif StartYear then return HF.LinkToCategory(StartMonth, StartMonth) .. ', ' ..           HF.LinkToCategory(StartYear, StartYear) end

end

function Infobox._DatesPublishedLabel( args ) local StartYear = args.StartYear or nil local EndYear = args.EndYear or nil local StartMonth = args.StartMonth or nil local EndMonth = args.EndMonth or nil if StartMonth then return 'Dates Published' elseif EndYear then return 'Years Published' elseif StartYear then return 'Began' end

end

return Infobox