PageSourceSearch

https://af.codes/scripts/age.js

js af.codes collected 2026-09-25 22:15:15 UTC 667 bytes, 18 lines download raw bytes

1(function () {
2    var fmt = new Intl.DateTimeFormat('en-US', {
3        timeZone: 'America/Chicago',
4        year: 'numeric', month: 'numeric', day: 'numeric'
5    });
6    var parts = Object.fromEntries(
7        fmt.formatToParts(new Date()).map(function (p) { return [p.type, +p.value]; })
8    );
9    var birthYear = 1995, birthMonth = 7, birthDay = 28;
10    var years = parts.year - birthYear;
11    if (parts.month < birthMonth || (parts.month === birthMonth && parts.day < birthDay)) {
12        years--;
13    }
14    var ageSpans = document.getElementsByClassName('age');
15    for (var i = 0; i < ageSpans.length; i++) {
16        ageSpans[i].innerText = years;
17    }
18})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.