Content deleted Content added
DreamRimmer (talk | contribs) Restored revision 1305710703 by DreamRimmer (talk): Restore |
DreamRimmer (talk | contribs) fixes |
||
Line 571:
const timestampMatch = rfcquoteText.match(/(\d{2}:\d{2}, \d{1,2} \w+ \d{4} \(UTC\))/);
if (timestampMatch) {
let timePart = dtParts[0];
`https://en.wikipedia.org/wiki/${encodeURIComponent(pageName)}#${encodeURIComponent(anchor)}` :▼
let day = isoStr[1];
parsedDate = Date.parse(timestampStr.replace(' (UTC)', ' UTC'));
}▼
daysDiff = Math.floor((now - parsedDate) / (1000 * 60 * 60 * 24));
}▼
let parsedDate = new Date(timestampStr.replace(' (UTC)', ' UTC'));
let now = new Date();
daysDiff = Math.floor((now - parsedDate) / (1000 * 60 * 60 * 24));
}▼
}
`https://en.wikipedia.org/wiki/${encodeURIComponent(pageName)}`;
daysOld: daysDiff,
timestamp: timestampStr
});
}
Line 615 ⟶ 643:
let html = `<p><small>Current date: ${currentDate}</small></p>`;
html += `<p>Age filter: <select id="rfc-age-filter
ageOptions.forEach(age => {
const selected = age === 7 ? ' selected' : '';
Line 621 ⟶ 649:
});
html += `</select></p>`;
let table });
▲ html += `<th>${age}d</th>`;
▲ });
html += '</tr></thead><tbody>';▼
▲ html += `<tr><td>${topic}</td>`;
▲ ageOptions.forEach(age => {
const count = rfcs.filter(rfc => rfc.topic === topic && rfc.daysOld <= age).length;▼
▲ html += `<td>${count}</td>`;
▲ });
▲ html += '</tr>';
▲ });
const filteredRfcs = rfcs.filter(rfc => rfc.daysOld <= age);▼
▲ const displayStyle = age === 7 ? 'block' : 'none';
} else {
▲ if (topicRfcs.length > 0) {
▲ topicRfcs.forEach(rfc => {
▲ });
▲ html += '</ul>';
▲ }
▲ });
}
html += '<p><a href="https://en.wikipedia.org/wiki/Wikipedia:Requests_for_comment/All" target="_blank">All open RfCs</a></p>';
html += `<script>
function
var
▲
});
document.getElementById('rfc-list-table').innerHTML = (${renderRfCTable.toString()})(filteredRfcs);
}
document.getElementById('rfc-age-filter').addEventListener('change', updateRfCTable);
updateRfCTable();
</script>`;
|