Hi,
I’m trying to show only today’s and future dates in a repeater. This is what I have now. Unfortunately it doesn’t work and the date still stays in the past…
Anyone know how I can get this to work?
Thanks
Hi,
I’m trying to show only today’s and future dates in a repeater. This is what I have now. Unfortunately it doesn’t work and the date still stays in the past…
Anyone know how I can get this to work?
Thanks
The date object should be create with the capital D
let today = new Date();
Line 8 should contain the dataset ID, not the repeater ID.
And line 11 should contain the field key of the content collection field.
Hi,
I tried it but still can’t get it to work. This is what I have now.
It’s a repeater that I use.
Sorry, I’m very new to this. Try to understand more and more
From what I can see it should be $w(“listRepeater”) not $(“projects”)
This also doesn’t work.
Here’s the end code you should have:
import wixData from 'wix-data';
$w.onReady(function () {
let today = new Date();
$w('#dataset1').setFilter(wixData.filter()
.le('_createdDate', today)
);
});
Replace:
#dataset1 - with your dataset ID
_createdDate - with the field key of the date field in the content collection.
Thanks
Only i change .le to .ge for te date today and further