This commit is contained in:
naielv
2025-09-07 14:16:42 +02:00
parent a59a26fa29
commit 3bfbdc11af
2 changed files with 154 additions and 5 deletions

View File

@@ -733,6 +733,15 @@ function TS_IndexElement(
return true;
}
break;
case "fecha":
case "fecha-iso":
// Format date as DD/MM/YYYY for searching
if (value) {
const fechaArray = value.split("-");
const formattedDate = `${fechaArray[2]}/${fechaArray[1]}/${fechaArray[0]}`;
if (formattedDate.includes(searchValue)) return true;
}
break;
default:
// For raw and other types, search in the direct value
if (String(value).toLowerCase().includes(searchValue)) return true;
@@ -801,6 +810,15 @@ function TS_IndexElement(
tdRaw.innerHTML = rawContent;
new_tr.appendChild(tdRaw);
break;
case "fecha":
case "fecha-iso":
const tdFechaISO = document.createElement("td");
if (data[key.key]) {
const fechaArray = data[key.key].split("-");
tdFechaISO.innerText = fechaArray[2] + "/" + fechaArray[1] + "/" + fechaArray[0];
}
new_tr.appendChild(tdFechaISO);
break;
case "template":
const tdCustomTemplate = document.createElement("td");
new_tr.appendChild(tdCustomTemplate);