I’m trying to filter records in my database so that old events aren’t imported into a repeater.
However it is filtering out all event and I can’t seem to figure out what I’m doing wrong.
Any help/advice very much appreciated.
import wixData from ‘wix-data’ ;
// link button
$w.onReady(() => {
$w( ‘#repeater2’ ).onItemReady(($wInRepeater, itemData) => {
const thereIsNoUrl = !itemData.url
if (thereIsNoUrl) $wInRepeater( ‘#button16’ ).collapse()
if (thereIsNoUrl) $wInRepeater( ‘#box5’ ).collapse()
})
// filtering out old events
$w( “#dataset1” ).onReady( () => {
let today = new Date();
console.log(today);
today.setHours( 0 );
today.setMinutes( 0 );
today.setSeconds( 0 );
console.log(today);
$w( “#dataset1” ).setFilter(wixData.filter()
.ge( “#datetime” ,today)
);
});
})