User:Esquivalience/afd.js

function getDate(date) { var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];	var dateArr = [date.getUTCFullYear, months[date.getUTCMonth], date.getUTCDate]; return dateArr; }

var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0]; var li = document.createElement("li"); var na = document.createElement("a");

var dateObj1 = new Date; var date = getDate(dateObj1); na.appendChild(document.createTextNode("Newest AfD log")); na.href = "https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Log/" + date[0] + "_" + date[1] + "_" + date[2];

li.appendChild(na);

tb.appendChild(li);

// 2

var li2 = document.createElement("li"); var na2 = document.createElement("a");

var dateObj2 = new Date(new Date.setDate(new Date.getDate-7)); var date2 = getDate(dateObj2); na2.appendChild(document.createTextNode("Old AfD log")); na2.href = "https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Log/" + date2[0] + "_" + date2[1] + "_" + date2[2];

li2.appendChild(na2);

tb.appendChild(li2);