Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
functionDateSub(Date1,Date2){vartimeDifference=Date2-Date1;varminutesAgo=Math.round(timeDifference/1000/60);varhoursAgo=0vardaysAgo=0varhoursText='hour'vardaysText='day'while(minutesAgo>=60){minutesAgo=minutesAgo-60;hoursAgo++;}while(hoursAgo>=24){hoursAgo=hoursAgo-24;daysAgo++;}if(hoursAgo!=1)hoursText=hoursText+'s';if(daysAgo!=1)daysText=daysText+'s';if(daysAgo>0){if(hoursAgo>0){if(minutesAgo<=1){minutesAgo=daysAgo+' '+daysText+', '+hoursAgo+' '+hoursText;}else{minutesAgo=daysAgo+' '+daysText+', '+hoursAgo+' '+hoursText+', '+minutesAgo+' minutes';}}else{if(minutesAgo<=1){minutesAgo=daysAgo+' '+daysText;}else{minutesAgo=daysAgo+' '+daysText+', '+minutesAgo+' minutes';}}}else{if(hoursAgo>0){if(minutesAgo<=1){minutesAgo=hoursAgo+' '+hoursText;}else{minutesAgo=hoursAgo+' '+hoursText+', '+minutesAgo+' minutes';}}else{if(minutesAgo<=1){minutesAgo='Less than a minute';}else{minutesAgo=minutesAgo+' minutes';}}}returnminutesAgo;}if(document.getElementById('mw-diff-otitle1')||document.getElementById('mw-diff-ntitle1')){functionconvertTimestampStringToDate(id){vartimestamp=document.getElementById(id).firstChild.firstChild.firstChild.nodeValue;varstr=/evision as of /gstr.lastIndex=0;str.test(timestamp)vardate=timestamp.substring(str.lastIndex)/*All this following bogus crap is because Safaridoesn't recognize Wikipedia's date format.Every other browser can just use the date stringobject above, but Safari is retarded*/varstr1=/[A-z]+/varstr2=/\d+/gvarmonthtext=date.match(str1);vartestdate=date.match(str2);varhours=testdate[0];varminutes=testdate[1];varday=testdate[2];varyear=testdate[3];varmonths=['January','February','March','April','May','June','July','August','September','October','November','December'];for(iinmonths){if(monthtext==months[i]){varmonth=i;break;}i++}/*End Safari madness*/date=newDate(year,month,day,hours,minutes);returndate;}varleftNode=document.getElementById('mw-diff-otitle1');varrightNode=document.getElementById('mw-diff-ntitle1');varfirstDate=convertTimestampStringToDate('mw-diff-otitle1');varsecondDate=convertTimestampStringToDate('mw-diff-ntitle1');functionTimeBetweenDiffs(){varminutesAgo=DateSub(firstDate,secondDate);varnewNode=document.createElement('span');newNode.setAttribute('style','font-weight:bold; color:red;')newNode.appendChild(document.createTextNode('('+minutesAgo+' later)'));newNode.appendChild(document.createElement('br'));rightNode.insertBefore(newNode,rightNode.firstChild);}functionTimeSinceDiff(){varDateNow=newDate();varminutesAgo1=DateSub(firstDate,DateNow);varminutesAgo2=DateSub(secondDate,DateNow);document.getElementById('mw-diff-otitle1').title=minutesAgo1+' ago';document.getElementById('mw-diff-ntitle1').title=minutesAgo2+' ago';vart=setTimeout("TimeSinceDiff()",60000);}$(window).load(TimeSinceDiff);// Adds time since displayed diffs as tooltip$(window).load(TimeBetweenDiffs);// Adds time between diffs}