Hi, I have a page on my site that is supposed to show items in a repeater up to todays date and not after. Right now, its showing all the images that people have uploaded through Christmas. Can you take a look and help me fix the code to only show up to todays date?
import wixData from ‘wix-data’;
import wixSite from ‘wix-site’;
let timezone = wixSite.timezone; // “America/New_York”
$w.onReady( function () {
const today = new Date();
const month = today.getMonth();
console.log(“Today is " + today);
let current = $w(”#artist").getCurrentItem();
let email = current.email;
$w(“#master2019Dataset”).onReady( async () => {
$w(“#master2019Dataset”).setFilter(wixData.filter()
.eq(“releaseMonth”, month)
.eq(“email”, email)
)
.then(() => {
console.log(“Dataset is now matching todays day.”);
$w(‘#galleryRepeater’).expand();
})
. catch ((err) => {
console.log(err);
});
});
$w(“#galleryRepeater”).onItemReady(($item, itemData, index) => {
let getAvailable = itemData.sold;
if (getAvailable) {
$item(“#availableButton”).label = “AVAILABLE”;
$item(“#availableButton”).enable();
} else {
$item(“#availableButton”).label = “SOLD”;
$item(“#availableButton”).disable();
}
});
});