<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://knowislam.wiki/topic/?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js</id>
	<title>MediaWiki:Common.js - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://knowislam.wiki/topic/?action=history&amp;feed=atom&amp;title=MediaWiki%3ACommon.js"/>
	<link rel="alternate" type="text/html" href="https://knowislam.wiki/topic/?title=MediaWiki:Common.js&amp;action=history"/>
	<updated>2026-08-11T11:37:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://knowislam.wiki/topic/?title=MediaWiki:Common.js&amp;diff=204&amp;oldid=prev</id>
		<title>Menj: Created page with &quot;/* Any JavaScript here will be loaded for all users on every page load. */  function calculateAgeAtDeath() {     var birthElems = document.querySelectorAll(&#039;[data-birth]&#039;);     var deathElems = document.querySelectorAll(&#039;[data-death]&#039;);     birthElems.forEach(function(birthElem, index) {         var birthDate = new Date(birthElem.getAttribute(&#039;data-birth&#039;));         var deathDate = new Date(deathElems[index].getAttribute(&#039;data-death&#039;));         if (!isNaN(birthDate) &amp;&amp; !...&quot;</title>
		<link rel="alternate" type="text/html" href="https://knowislam.wiki/topic/?title=MediaWiki:Common.js&amp;diff=204&amp;oldid=prev"/>
		<updated>2024-06-25T09:40:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Any JavaScript here will be loaded for all users on every page load.: &lt;/span&gt;  function calculateAgeAtDeath() {     var birthElems = document.querySelectorAll(&amp;#039;[data-birth]&amp;#039;);     var deathElems = document.querySelectorAll(&amp;#039;[data-death]&amp;#039;);     birthElems.forEach(function(birthElem, index) {         var birthDate = new Date(birthElem.getAttribute(&amp;#039;data-birth&amp;#039;));         var deathDate = new Date(deathElems[index].getAttribute(&amp;#039;data-death&amp;#039;));         if (!isNaN(birthDate) &amp;amp;&amp;amp; !...&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/* Any JavaScript here will be loaded for all users on every page load. */&lt;br /&gt;
&lt;br /&gt;
function calculateAgeAtDeath() {&lt;br /&gt;
    var birthElems = document.querySelectorAll(&amp;#039;[data-birth]&amp;#039;);&lt;br /&gt;
    var deathElems = document.querySelectorAll(&amp;#039;[data-death]&amp;#039;);&lt;br /&gt;
    birthElems.forEach(function(birthElem, index) {&lt;br /&gt;
        var birthDate = new Date(birthElem.getAttribute(&amp;#039;data-birth&amp;#039;));&lt;br /&gt;
        var deathDate = new Date(deathElems[index].getAttribute(&amp;#039;data-death&amp;#039;));&lt;br /&gt;
        if (!isNaN(birthDate) &amp;amp;&amp;amp; !isNaN(deathDate)) {&lt;br /&gt;
            var age = deathDate.getFullYear() - birthDate.getFullYear();&lt;br /&gt;
            var m = deathDate.getMonth() - birthDate.getMonth();&lt;br /&gt;
            if (m &amp;lt; 0 || (m === 0 &amp;amp;&amp;amp; deathDate.getDate() &amp;lt; birthDate.getDate())) {&lt;br /&gt;
                age--;&lt;br /&gt;
            }&lt;br /&gt;
            birthElem.parentNode.querySelector(&amp;#039;.age-at-death&amp;#039;).innerText = age;&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
document.addEventListener(&amp;#039;DOMContentLoaded&amp;#039;, calculateAgeAtDeath);&lt;/div&gt;</summary>
		<author><name>Menj</name></author>
	</entry>
</feed>