[SOLVED] Search a database based on date: _createdDate

Hi, I’d like to create a dropdown list sort of _createdDate. Can you please help me to verify the code?

$w.onReady(function () {    uniqueDropDown1();});function uniqueDropDown1 (){    wixData.query("All_Votes").descending("_createdDate")      .contains("_createdDate", $w("#datePicker2").value)      .limit(1000)      .find()      .then(results => {            console.log (results)const uniqueTitles = getUniqueTitles(results.items);           $w("#datePicker2").value = buildOptions(uniqueTitles);      });function getUniqueTitles(items) {const titlesOnly = items.map(item => item._createdDate);return [...new Set(titlesOnly)];    }function buildOptions(uniqueList) {return uniqueList.map(curr => {return {label:curr, value:curr};        });    }}