_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

User:Equazcion/LagToMinutesBeta.js

In this article, we will explore the fascinating world of User:Equazcion/LagToMinutesBeta.js, a topic that has captured the attention of many people over time. From its impact on society to its implications in everyday life, User:Equazcion/LagToMinutesBeta.js has been the subject of debate and analysis by experts in various disciplines. Whether we're talking about its influence on history, its relevance in today's world, or its projections into the future, User:Equazcion/LagToMinutesBeta.js remains a topic of interest and curiosity for many. Throughout this article, we will examine different aspects of User:Equazcion/LagToMinutesBeta.js, from its origins to its possible repercussions, with the aim of providing a broad and detailed overview of this exciting topic.
// Debug mode: Set testSecs to desired test lag seconds. Should be a string in quotes with comma separator(s).
if (typeof testSecs == 'undefined') var testSecs = "621,139";

// Insert fake lag notice with test seconds value
if (wgPageName == 'Special:Watchlist') $('#contentSub').after('<div class="mw-lag-warn-high"><p>Due to high database server lag, changes newer than ' + 
	testSecs + ' seconds may not appear in this list.</p></div>');

// Script begins here
if ((wgPageName == 'Special:Watchlist') && ($('.mw-lag-warn-high').length > 0)) {
	
	var lagText = $('.mw-lag-warn-high p').html();
	var lagSecs = lagText.replace(/,/g , '').match(/\d+/g);
	
	if (lagSecs >= 60){
		
		var lagMin=0, lagHours=0, lagDays=0;
		
		lagMin = Math.floor(lagSecs / 60);
		lagSecs = lagSecs % 60;
		var lagCount = lagMin + " minutes, " + lagSecs + " seconds";
		
		if (lagMin >= 60){
			lagHours = Math.floor(lagMin / 60);
			lagMin = lagMin % 60;
			lagCount = lagHours + " hours, " + lagMin + " minutes, " + lagSecs + " seconds";
		
			if (lagHours >= 24){
				lagDays = Math.floor(lagHours / 24);
				lagHours = lagHours % 24;
				lagCount = lagDays + " days, " + lagHours + " hours, " + lagMin + " minutes, " + lagSecs + " seconds";
			}	
		}
		
		if (lagMin == 1) lagCount = lagCount.replace('minutes','minute');
		if (lagHours == 1) lagCount = lagCount.replace('hours','hour');
		if (lagDays == 1) lagCount = lagCount.replace('days','day');
		
		var newText = lagText.replace("seconds", "seconds (" + lagCount + ")");
		$('.mw-lag-warn-high p').html(newText);
		
	}
}