I have a simple code not working with dates:
let today=Date();
let category = $w(“#dropdown1”).value;
let counter = 0;
wixData.query(“Members”)
.eq(“membercategory”, category)
.ge(“expirationdate”, today)
.count()
.then((number) => {
counter = number;
$w(“#text50”).text = counter.toString();
if (counter >19){
$w(“#html1”).hide()
$w(“#button10”).disable();
}
});
expirationdate is in Date Time format, but it seems today (Date()) is in string:
How can I make it to Date and Time to compare with expirationdate field?
Thanks!
Imre