Module:Sandbox/Hellknowz/Test: Difference between revisions

Content deleted Content added
oh so like it's not actually wikitext it returns
(re)make dt metadata emitter
Line 646:
]]
 
--[[
function main.emitMetadata(frame)
 
-- First parse the date and see if we get a valid output date
local dateresult, startDate, startTime, endDate, endTime = parseDateString(frame.args[1])
if (not date) then return nil end
-- We are only doing this for a valid date
if (notresult date~= PARSERESULT_OKAY) then return nil end
local dtstartSpan, dtendSpan
-- If we have a start value and we're told to output it
if ((startDate or startTime) and frame.args.dtstart and frame.args.dtstart == 'yes') then
if (startDate and startTime) then dtstartSpan = '<span class="dtstart">' .. startDate .. 'T' .. startTime .. '</span>'
elseif (startDate) then dtstartSpan = '<span class="dtstart">' .. startDate .. '</span>'
else dtstartSpan = '<span class="dtstart">' .. startTime .. '</span>' end
end
 
-- If we have an end value and we're told to output it
local spanClass = frame.args.spanClass or 'bday dtstart published updated'
if ((endDate or endTime) and frame.args.dtend and frame.args.dtend == 'yes') then -- end values only happen when start values happen
if (endDate and endTime) then dtstartSpan = '<span class="dtstart">' .. endDate .. 'T' .. endTime .. '</span>'
elseif (endDate) then dtstartSpan = '<span class="dtstart">' .. endDate .. '</span>'
else dtstartSpan = '<span class="dtstart">' .. endTime .. '</span>' end
end
 
if (dtstartSpan and dtendSpan) then return '<span style="display:none">&#160;(<span class="' .. spanClassdtstartSpan .. '">' .. datedtendSpan .. '</span>)</span>'
elseif (dtstartSpan) then return '<span style="display:none">&#160;(' .. dtstartSpan .. ')</span>'
elseif (dtendSpan) then return '<span style="display:none">&#160;(' .. dtendSpan .. ')</span>'
else return nil end
 
end
]]
 
--[[