I have a date picker for users to select a date and a dropdown input for them to select time. I want to be able to change the available times based on the date value selected.
For example, on Halloween I will only offer them 3 time selections instead of the usual 9.
At first when you pick a date from the date picker, it returns a date and a time, so in your case you have to modify that value to be only a date and here is a cool way to do that :
const options = {
day: "numeric",
month: "short",
year: "numeric"
};
let date = $w("#datePicker").value.toLocaleDateString("en-US",options);
console.log(date); // value will look like this => Sep 22, 2018
Then, for the dropdown options, you can define them by code inside the if statement using $w(“#dropdown”).options . For more information - Read This
@mhammouz any chance you might also know how to format the following onKeypress?
add a space every 4th digit input:
example
12345678 ----> 1234 5678
but only as the user types, so as they type it would go:
1
12
123
1234(space)
1234 5…