I am having trouble with these lines of code. The day picker drop down displays the label over and over again instead of the dates.
$w.onReady(function () {
const today = new Date();
const daysOfTheWeek = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
$w('#dayPicker').options = getWeekDays(today).map(day => {
return {
label: '${daysOfTheWeek[day.date.getDay()]} ${day.date.toLocaleDateString("en-GB")}',
value: day.date.toISOString()
}
});
$w('#dayPicker').onChange((event, $w) => {
const selectedDate = new Date(event.target.value);
findAvailableSlots(selectedDate);
});
$w("#submitButton").onClick(() => validateAndSubmitForm());
});