Events skill: manage multiday events

Hi!
I’m trying to find the way to manage multiday events for my events skill.

I have all events in an Airbase base with these columns: start_date, end_date, description, more_info.

In the skill I have a capture block to capture the user’s date in the variable userDate.

If I use the FilterByFormula “SEARCH” with {userDate}, the skill retrieve only the events that start in this particular date.

But I need to include in the json response the multiday events (already started in the past, so the start date can’t be the userDate).

I tried to retrieve all events and filter them via a Block code with this code, deleting all the single day events in the past and all finished multiday events:

for (var r = 0; r < jsonResponse.records.lenght; r++) {
if(jsonResponse.records[r].fields.start_date < userDate || jsonResponse.records[r].fields.end_date < userDate) {
delete jsonEventi.records[r];
}
}

but doesn’t work at all…

What can I do?
Thanks in advance.