Question:
Is it possible to disable days of the week based on user input? for example: "If $w(element).text = “0” then disable days of the week for sunday and so on.
Product:
Wix Editor
What are you trying to achieve:
I am trying to disable multile days of week at one time based on user input or on change or on click.
What have you already tried:
$w(“#element”).onChange((event) => {
// filter
$w(“#datasetmy”).setFilter(wixData.filter()
.eq(“serviceProvider”, $w(“#element”).value)
)
.then(() => {
$w(“#repeaterDisabledDates”).onItemReady(($item, itemData, index) => {
if ($item(“#disableDates”).text === “1”) {
$w(“#datePicker1”).disabledDaysOfWeek = [1];
}
if ($item(“#disableDates”).text === “2”) {
$w(“#datePicker1”).disabledDaysOfWeek = [2];
}
if ($item(“#disableDates”).text === “3”) {
$w(“#datePicker1”).disabledDaysOfWeek = [3];
}
if ($item(“#disableDates”).text === “4”) {
$w(“#datePicker1”).disabledDaysOfWeek = [4];
}
if ($item(“#disableDates”).text === “5”) {
$w(“#datePicker1”).disabledDaysOfWeek = [5];
}
if ($item(“#disableDates”).text === “6”) {
$w(“#datePicker1”).disabledDaysOfWeek = [6];
}
if ($item(“#disableDates”).text === “0”) {
$w(“#datePicker1”).disabledDaysOfWeek = [0];
}
})
})
})