From 948be76654e3744ef217014cf712ce5a1d11a114 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 12 Jan 2024 16:09:56 +0100 Subject: [PATCH] fix: refs #6656 fix ifisemptytext --- js/clockIn.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/js/clockIn.js b/js/clockIn.js index 78a058a..b4f35c1 100644 --- a/js/clockIn.js +++ b/js/clockIn.js @@ -210,22 +210,19 @@ function printErrores(errores) { } function ifIsEmpty(value) { - if (value.trim().length === 0) { - return "hide"; - } else { - return "show"; - } + if (!value.trim()) return "hide"; + return "show"; + } function ifIsEmptyImage(value) { - if (value.trim().length === 0) { - return "img/in.svg"; - } else { - return "img/" + value + ".svg"; - } + if (!value.trim()) return "img/in.svg"; + return "img/" + value + ".svg"; + } -function ifIsEmptyText(value = 0) { +function ifIsEmptyText(value) { + if (!value.toString().trim()) return "00:00"; return value; }