From b260cf369e8aa984e8a1428f7c8836463361553b Mon Sep 17 00:00:00 2001 From: Russel Yasol Date: Tue, 14 May 2024 06:58:58 +0800 Subject: [PATCH] added logic check for missing hour on uptime --- simpleadmin/www/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/simpleadmin/www/index.html b/simpleadmin/www/index.html index 07e01fa..5899833 100644 --- a/simpleadmin/www/index.html +++ b/simpleadmin/www/index.html @@ -1217,7 +1217,7 @@ // If uptimeArray[3] is not empty, and the value doesnt have : in it if ( uptimeArray[3] !== "" && - uptimeArray[3].match(/:/) == null + uptimeArray[3].match(/:/) == null && uptimeArray[4].match(/days/) == null ) { this.uptime = uptimeArray[3] + @@ -1232,7 +1232,11 @@ " hours and " + uptimeArray[3].split(":")[1].replace(",", "") + " minutes"; - } else { + } else if (uptimeArray[5].match(/:/) == null && uptimeArray[4].match(/days/) != null) { + this.uptime = uptimeArray[3].replace(",", "") + " days and " + uptimeArray[5] + " minutes"; + } + + else { this.uptime = uptimeArray[4].split(":")[0] + " hours and " +