I’m looking to add a “new” label on item in my repeater that’s 5 days old and closer.
Right now I have this code, but it doesn’t show anything.
const currentDate = new Date();
const fiveDaysAgo = new Date();
fiveDaysAgo.setDate(currentDate.getDate() - 5);
$w("#repeater1").forEachItem(($item, itemData) => {
const itemDate = itemData._createdDate;
if (itemDate >= fiveDaysAgo) {
$item("#nouvelAjout").show();
}
});