March 18 2026: Update attendance report filter multiple employees 2

This commit is contained in:
2026-03-18 10:14:07 -04:00
parent 10c2f09586
commit cf9e1fceac
+10 -4
View File
@@ -133,8 +133,12 @@ function applyFilters() {
const searchTerm =
document.getElementById("searchInput")?.value.toLowerCase() || "";
const locationFilter = document.getElementById("location")?.value || "";
const employeeFilter =
document.getElementById("employee")?.value.toLowerCase() || "";
// Support comma-separated multi-employee filter
const employeeFilterRaw =
document.getElementById("employee")?.value || "";
const employeeFilterIds = employeeFilterRaw
? employeeFilterRaw.split(",").map(function(s) { return s.trim().toLowerCase(); }).filter(Boolean)
: [];
filteredData = attendanceData.filter((record) => {
const matchesSearch =
@@ -146,8 +150,10 @@ function applyFilters() {
const matchesLocation =
!locationFilter || record.location === locationFilter;
const matchesEmployee =
!employeeFilter ||
record.employeeId.toLowerCase().includes(employeeFilter);
employeeFilterIds.length === 0 ||
employeeFilterIds.some(function(id) {
return record.employeeId.toLowerCase() === id;
});
return matchesSearch && matchesLocation && matchesEmployee;
});