Hi everyone.
I would like to display the no. of new member using WixDataQuery.
This is my idea but it is not working:
const today = new Date();
let mth = today.getMonth().toString();
if (mth === “0”) {
mth = “jan”; //not sure about the format
}
else if (mth === “1”) {
mth = “feb”;
}
//same code for 12mths
wixData.query(“Cand_reg”)
.contains(“_createdDate”, mth) //not working and cannot only search for same year
.count()
.then((num) => {
let numberOfItems = num;
$w(“#amount”).text = numberOfItems.toString();
})
. catch ((error) => {
let errorMsg = error.message;
let code = error.code;
});
Thank you!!!