hw>WikiSysop (Created page with "local p = {} -- p stands for package function p.forDate( frame ) local todayU = frame:callParserFunction( '#time:U' ) local soonU = frame:callParserFunction( '#time:U...") |
m (1 revision imported) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 17: | Line 17: | ||
function p.getIndicator( frame, color ) | function p.getIndicator( frame, color ) | ||
-- adding the color in hidden text makes the indicator sortable in tables | -- adding the color in hidden text makes the indicator sortable in tables | ||
return "<span class='date-indicator' style='color: " .. color .. ";font-size:1em;'>◉<span style='display:none;'>" .. color .. "</span></span>"; | return "<span class='date-indicator' role='image' aria-label='" .. color .. "' style='color: " .. color .. ";font-size:1em;'>◉<span style='display:none;'>" .. color .. "</span></span>"; | ||
end | end | ||
return p | return p |
Latest revision as of 13:37, 10 June 2024
No content
local p = {} -- p stands for package
function p.forDate( frame )
local todayU = frame:callParserFunction( '#time:U' )
local soonU = frame:callParserFunction( '#time:U', '+2 months' )
local timeU = frame:callParserFunction( '#time:U', frame.args[1] )
local color = 'green'
if ( timeU < soonU ) then
color = 'orange'
end
if ( timeU < todayU ) then
color = 'red'
end
return p.getIndicator( frame, color )
end
function p.getIndicator( frame, color )
-- adding the color in hidden text makes the indicator sortable in tables
return "<span class='date-indicator' role='image' aria-label='" .. color .. "' style='color: " .. color .. ";font-size:1em;'>◉<span style='display:none;'>" .. color .. "</span></span>";
end
return p