Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ function initMonthDropdown(){
.filter(ev => !q || formatSearch(ev).includes(q))
.sort((a,b) => (a.start||"").localeCompare(b.start||""));

// βœ… FIX: Hide cells with no matching events when searching
if(q && dayEvents.length === 0){

cell.style.display = "none";

els.grid.appendChild(cell);

return;

}else{

cell.style.display = "";

}

if(dayEvents.length > 0){
anyMatch = true;
}
Expand All @@ -226,26 +241,8 @@ function initMonthDropdown(){
renderDayPanel();
});
// Show "No events found" only after checking all days
if(q){
let noResultEl = document.getElementById("noResults");

if(!noResultEl){
noResultEl = document.createElement("div");
noResultEl.id = "noResults";
noResultEl.style.textAlign = "center";
noResultEl.style.padding = "10px";
noResultEl.style.fontWeight = "bold";
noResultEl.style.color = "red";
els.grid.parentNode.appendChild(noResultEl);
}

if(!anyMatch){
noResultEl.textContent = "No events found";
noResultEl.style.display = "block";
} else {
noResultEl.style.display = "none";
}
}


const head = document.createElement("div");
head.className = "date";
Expand Down