ব্যবহারকারী:ARI
অবয়ব
<script> (function () {
function timeAgo(dateString) {
const now = new Date();
const then = new Date(dateString);
let years = now.getFullYear() - then.getFullYear();
let months = now.getMonth() - then.getMonth();
if (months < 0) {
years--;
months += 12;
}
if (years > 0) {
return years + " year" + (years > 1 ? "s" : "") +
(months ? ", " + months + " month" + (months > 1 ? "s" : "") : "");
}
return months + " month" + (months !== 1 ? "s" : ""); }
const username = 'ARI';
new mw.Api().get({
action: 'query',
list: 'usercontribs',
ucuser: username,
uclimit: 1,
ucdir: 'newer',
format: 'json'
}).done(function (data) {
const contribs = data.query.usercontribs;
if (!contribs.length) {
$('.wiki-joined').text('Not active here');
return;
}
const firstEdit = contribs[0].timestamp;
$('.wiki-joined').text(
timeAgo(firstEdit)
);
});
})(); </script>