#6656 fix timetable #19

Merged
jorgep merged 2 commits from 6656-fixTimeTable into test 2024-01-17 14:01:06 +00:00
1 changed files with 3 additions and 8 deletions
Showing only changes of commit d3f14d8ca3 - Show all commits

View File

@ -210,20 +210,15 @@ function printErrores(errores) {
} }
function ifIsEmpty(value) { function ifIsEmpty(value) {
if (!value.trim()) return "hide"; return value.trim() ? "show" : "hide";
jorgep marked this conversation as resolved Outdated

Si los valores van a ser 2 y tan cortos, quizas lo cambiaría a ternario

Si los valores van a ser 2 y tan cortos, quizas lo cambiaría a ternario
return "show";
} }
function ifIsEmptyImage(value) { function ifIsEmptyImage(value) {
if (!value.trim()) return "img/in.svg"; return value.trim() ? `img/${value}.svg` :"img/in.svg";
return "img/" + value + ".svg";
} }
jorgep marked this conversation as resolved
Review

Lo revisamos porque se podría dejar en una línea.
Ya que construyes un string en la 220, puedes aprovechar a darle un valor por defecto a value que sea in

Lo revisamos porque se podría dejar en una línea. Ya que construyes un string en la 220, puedes aprovechar a darle un valor por defecto a value que sea in
function ifIsEmptyText(value) { function ifIsEmptyText(value) {
jorgep marked this conversation as resolved
Review

Se podría usar template string

Se podría usar template string
if (!value.toString().trim()) return "00:00"; return value.toString().trim() ? value : "00:00";
return value;
} }
function cerrar(){ function cerrar(){