Drop Down list doesn't work

Hi
I added a drop down list to my form, and when I try to use it, I see blank lines instead of the items I added.
Any help would be great!

Hi,

Welcome to the Wix Code forums.

How are you adding the dropdown items? Please show your code and dropdown settings.

Yisrael

I have the code below and it doesn’t work:

export function datePicker1_change() {

$w('#dataset1').setFilter(wixData.filter()
	.eq('fechaDeIngreso', $w('#datePicker1').value));
}

My table just won’t populate after selecting a date.
Help please. :frowning:

Hi,

The date picker returns a date object that always represents midnight.
Using equals() to find records that were created on the same day will not work, since it looks for records that were created exactly on midnight (with millisecond precision).
Therefore in order to execute the filter command correctly you should search for records that were created during that day (between 00:00 and 23:59 of that same day) using the between() function

See the example below:

export function datePicker1_change(event) {
	const dayInMsMinusOne = (1000 * 60 * 60 * 24) - 1; 
	const dateOne = event.target.value; // (always midnight)
	const dateTwo = new Date(dateOne.getTime() + dayInMsMinusOne); //midnight plus midnight of the next day minus one millisecond

	$w('#dataset1').setFilter(wixData.filter()
		.between('_updatedDate', dateOne, dateTwo)
	);
}