Hi everyone, could anyone please give me a help on this bit of code?
I’m having a bit of trouble here when it comes to the dates. I have it up and running on other pages with 1 single date picker - this one: . ge ( “date_go” , ( $w ( “#date1” ). value )) , but with two, for some reason the whole search function stops working.
Does anyone please have any idea how to go around this issue?
A secondary - less important for now - question is this line here: . contains ( ‘destinationCountry’ , String ( $w ( “#checkboxGroup1” ). value )).
It was originally with .hasSome, instead of .contains but all my “.hasSome” have recently stopped working, does anyone have any idea why?
Thank you so much if you have the change to give me a hint on this
export function multifilter() {
$w("#dataset1").setFilter(wixData.filter()
.contains("originCity", String($w("#dropdown").value))
.ge("date_go", ($w("#date1").value))
.le("date_back",($w("#date2").value))
.contains('destinationCountry', String($w("#checkboxGroup1").value))
.contains("stars", String($w("#checkboxGroup2").value))
.le("price", Number($w("#slider").value))
)
.then(() => {
console.log("Dataset is now filtered");
})
.catch((err) => {
console.log(err);
});