https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AHighlighted_date_list
Module:Highlighted date list - Revision history
2025-06-16T01:01:34Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.5
https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653610581&oldid=prev
MSGJ: let's try without the 120%
2015-03-26T14:34:53Z
<p>let's try without the 120%</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:34, 26 March 2015</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 73:</td>
<td colspan="2" class="diff-lineno">Line 73:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> highlighter</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> highlighter</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :css('background-color', color)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :css('background-color', color)</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> :css('font-size', '120%')</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :wikitext(lang:getArrow('forwards'))</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> :wikitext(lang:getArrow('forwards'))</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return tostring(highlighter)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return tostring(highlighter)</div></td>
</tr>
</table>
MSGJ
https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653587465&oldid=prev
Mr. Stradivarius: Protected Module:Highlighted date list: High-risk Lua module ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only template editors and admins] (indefinite))
2015-03-26T10:07:43Z
<p>Protected Module:Highlighted date list: <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk Lua module</a> ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only template editors and admins] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:07, 26 March 2015</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Mr. Stradivarius
https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653561669&oldid=prev
Mr. Stradivarius: we need to subtract the grace period, not add it
2015-03-26T04:30:13Z
<p>we need to subtract the grace period, not add it</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:30, 26 March 2015</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 56:</td>
<td colspan="2" class="diff-lineno">Line 56:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local timestamp</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local timestamp</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if gracePeriod then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if gracePeriod then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> timestamp = 'now <del style="font-weight: bold; text-decoration: none;">+</del> ' .. gracePeriod</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> timestamp = 'now <ins style="font-weight: bold; text-decoration: none;">-</ins> ' .. gracePeriod</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> timestamp = 'now'</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> timestamp = 'now'</div></td>
</tr>
</table>
Mr. Stradivarius
https://en.wikipedia.org/w/index.php?title=Module:Highlighted_date_list&diff=653557696&oldid=prev
Mr. Stradivarius: create
2015-03-26T03:43:51Z
<p>create</p>
<p><b>New page</b></p><div>-- This module takes a list of dates and adds a marker highlighting the closest<br />
-- date in the future.<br />
<br />
local p = {}<br />
local lang = mw.language.getContentLanguage()<br />
<br />
local function normalizeDate(timestamp)<br />
local success, date = pcall(lang.formatDate, lang, 'Y-m-d', timestamp)<br />
return success and date<br />
end<br />
<br />
local function makeData(args)<br />
local data, unsorted = {}, {}<br />
for k, v in pairs(args) do<br />
if type(k) == 'string' then<br />
local datakey, num = k:match('^(.-)([1-9][0-9]*)$')<br />
if datakey == 'item' or datakey == 'date' then<br />
num = tonumber(num)<br />
unsorted[num] = unsorted[num] or {}<br />
unsorted[num][datakey] = v<br />
elseif datakey then<br />
error(string.format("invalid parameter '%s' detected", k), 3)<br />
end<br />
end<br />
end<br />
for num, t in pairs(unsorted) do<br />
if t.item and t.date then<br />
local date = normalizeDate(t.date)<br />
if not date then<br />
error(string.format(<br />
"invalid date '%s' in parameter 'date%d'",<br />
t.date, num<br />
), 3)<br />
end<br />
t.date = date<br />
table.insert(data, t)<br />
elseif t.item then<br />
error(string.format(<br />
"parameter 'item%d' was specified but parameter 'date%d' is missing",<br />
num, num<br />
), 3)<br />
else<br />
error(string.format(<br />
"parameter 'date%d' was specified but parameter 'item%d' is missing",<br />
num, num<br />
), 3)<br />
end<br />
end<br />
table.sort(data, function (t1, t2)<br />
return t1.date < t2.date<br />
end)<br />
return data<br />
end<br />
<br />
local function makeComparisonDate(gracePeriod)<br />
local timestamp<br />
if gracePeriod then<br />
timestamp = 'now + ' .. gracePeriod<br />
else<br />
timestamp = 'now'<br />
end<br />
local date = normalizeDate(timestamp)<br />
if date then<br />
return date<br />
else<br />
error(string.format("invalid grace period '%s'", gracePeriod), 3)<br />
end<br />
end<br />
<br />
local function makeHighlighter(color)<br />
color = color or '#FC6'<br />
local highlighter = mw.html.create('span')<br />
highlighter<br />
:css('background-color', color)<br />
:css('font-size', '120%')<br />
:wikitext(lang:getArrow('forwards'))<br />
return tostring(highlighter)<br />
end<br />
<br />
function p._main(args)<br />
local data = makeData(args)<br />
local comparisonDate = makeComparisonDate(args.graceperiod)<br />
local highlighter = args.highlighter or makeHighlighter(args.highlightercolor)<br />
local root = mw.html.create('ul')<br />
root<br />
:addClass(args.class)<br />
:cssText(args.style)<br />
local doneHighlight = false<br />
for i, t in ipairs(data) do<br />
local item<br />
if not doneHighlight and t.date >= comparisonDate then<br />
doneHighlight = true<br />
item = highlighter .. ' ' .. t.item<br />
else<br />
item = t.item<br />
end<br />
root<br />
:newline()<br />
:tag('li')<br />
:wikitext(item)<br />
end<br />
root:newline()<br />
return tostring(root)<br />
end<br />
<br />
function p.main(frame)<br />
local args = require('Module:Arguments').getArgs(frame, {<br />
wrappers = 'Template:Highlighted date list'<br />
})<br />
return p._main(args)<br />
end<br />
<br />
return p</div>
Mr. Stradivarius